3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /* // Example 1 $pizza = "piece1 piece2 piece3 piece4 piece5 piece6"; $pieces = explode(" ", $pizza); echo $pieces[0]; // piece1 echo 'PHP_EOL'; echo $pieces[1]; // piece2 echo PHP_EOL; // Example 2 $data = "foo:*:1023:1000::/home/foo:/bin/sh"; list($user, $pass, $uid, $gid, $gecos, $home, $shell) = explode(":", $data); echo $user; // foo echo PHP_EOL; echo $pass; // * echo PHP_EOL; */ $data = "https://www.evernote.com/shard/s7/sh/3d7d5fc3-ef4c-4ef1-b49b-833d2a944b3d/5bed95b61d2e414acba7eafce59382bf"; //evernote:///view/923142/s7/3d7d5fc3-ef4c-4ef1-b49b-833d2a944b3d/3d7d5fc3-ef4c-4ef1-b49b-833d2a944b3d/ list($one, $two, $three, $four, $five, $six, $seven, $eight) = explode("/",$data); echo $one; echo PHP_EOL; echo $two; echo PHP_EOL; echo $three; echo PHP_EOL; echo $four; echo PHP_EOL; echo $five; echo PHP_EOL; echo $six; echo PHP_EOL; echo $seven; echo PHP_EOL; echo $eight; echo PHP_EOL; ?>
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
https: www.evernote.com shard s7 sh 3d7d5fc3-ef4c-4ef1-b49b-833d2a944b3d 5bed95b61d2e414acba7eafce59382bf
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
https: Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/tH5VJ on line 24 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/tH5VJ on line 26 PHP_EOLwww.evernote.com Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/tH5VJ on line 28 PHP_EOLshard Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/tH5VJ on line 30 PHP_EOLs7 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/tH5VJ on line 32 PHP_EOLsh Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/tH5VJ on line 34 PHP_EOL3d7d5fc3-ef4c-4ef1-b49b-833d2a944b3d Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/tH5VJ on line 36 PHP_EOL5bed95b61d2e414acba7eafce59382bf Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/tH5VJ on line 38 PHP_EOL