3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = array('a', 'Z'); foreach ($tests as $packChar) { $packString = $packChar.'*'.$packChar.'*'.$packChar.'*'; $data = pack($packString, "foo", "bar", "baz"); echo "packed is: \n"; var_dump($data); $y = unpack('a3omg/a3lol/a3bbq' , $data ); echo "\nPHP 5.5 a\n"; var_dump($y); $y = unpack('Z3omg/Z3lol/Z3bbq' , $data ); echo "\nPHP 5.5 Z\n"; var_dump($y); }
Output for git.master, git.master_jit, rfc.property-hooks
packed is: string(9) "foobarbaz" PHP 5.5 a array(3) { ["omg"]=> string(3) "foo" ["lol"]=> string(3) "bar" ["bbq"]=> string(3) "baz" } PHP 5.5 Z array(3) { ["omg"]=> string(3) "foo" ["lol"]=> string(3) "bar" ["bbq"]=> string(3) "baz" } packed is: string(12) "foobarbaz" PHP 5.5 a array(3) { ["omg"]=> string(3) "foo" ["lol"]=> string(3) "ba" ["bbq"]=> string(3) "rb" } PHP 5.5 Z array(3) { ["omg"]=> string(3) "foo" ["lol"]=> string(0) "" ["bbq"]=> string(1) "r" }

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:
38.14 ms | 402 KiB | 8 Q