3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ (object)[ 'backslashN' => 'foo\nbar', 'newline' => "foo\nbar" ], ["Single'quote", 'Double"quote', '3 ', 10/3], '♡', null, 'false', '[]' => 'square braced key' ]; echo "<pre>\n"; var_export($array); echo "\n"; print_r($array); echo "\n"; var_dump($array); echo "\n"; echo json_encode($array, JSON_PRETTY_PRINT); echo "\n</pre>";
Output for git.master, git.master_jit, rfc.property-hooks
<pre> array ( 0 => (object) array( 'backslashN' => 'foo\\nbar', 'newline' => 'foo bar', ), 1 => array ( 0 => 'Single\'quote', 1 => 'Double"quote', 2 => '3 ', 3 => 3.3333333333333335, ), 2 => '♡', 3 => NULL, 4 => 'false', '[]' => 'square braced key', ) Array ( [0] => stdClass Object ( [backslashN] => foo\nbar [newline] => foo bar ) [1] => Array ( [0] => Single'quote [1] => Double"quote [2] => 3 [3] => 3.3333333333333 ) [2] => ♡ [3] => [4] => false [[]] => square braced key ) array(6) { [0]=> object(stdClass)#1 (2) { ["backslashN"]=> string(8) "foo\nbar" ["newline"]=> string(7) "foo bar" } [1]=> array(4) { [0]=> string(12) "Single'quote" [1]=> string(12) "Double"quote" [2]=> string(5) "3 " [3]=> float(3.3333333333333335) } [2]=> string(3) "♡" [3]=> NULL [4]=> string(5) "false" ["[]"]=> string(17) "square braced key" } { "0": { "backslashN": "foo\\nbar", "newline": "foo\nbar" }, "1": [ "Single'quote", "Double\"quote", "3 ", 3.3333333333333335 ], "2": "\u2661", "3": null, "4": "false", "[]": "square braced key" } </pre>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
29.88 ms | 409 KiB | 5 Q