PHP code example of jpuck / phpdev

1. Go to this page and download the library: Download jpuck/phpdev library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jpuck / phpdev example snippets




$haystack = 'test';
$needle   = 'te';
if(Functions::strbegins($haystack, $needle)){
	echo "$haystack begins with $needle";
}

use jpuck\phpdev\Functions as jp;

$array = [
	'first' =>
	[
		'second' =>
		[
			'third' =>
			[
				'forth' =>
				[
					'fifth' => 5
				]
			]
		]
	]
];

print_r($array);

jp::print_rt($array);

use jpuck\phpdev\Functions as jp;

$array = [
	'first' =>
	[
		'second' =>
		[
			'third' =>
			[
				'forth' =>
				[
					'fifth' => 5
				]
			]
		]
	]
];

var_export($array);

jp::arr_export($array);

$function = function(){};

$a = [
	'object' => new stdClass,
	'function' => $function,
];

$b = var_export($a, true);

eval("print_r($b);");

use jpuck\phpdev\Exceptions\Unimplemented;

class MyClass {
	public function foo() {
		// completed code
		return true;
	}

	/**
	 * @throws Unimplemented
	 */
	public function bar() {
		// work in progress

		throw new Unimplemented(__METHOD__);

		return true;
	}
}