3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($path) { echo "Testing: $path\n"; $file = new \SplFileInfo($path); var_dump($file->getBasename()); var_dump($file->getFilename()); } test('/dir/anotherdir/basedir//'); test('/dir/anotherdir/basedir/'); test('/dir/anotherdir/basedir'); test('/dir/anotherdir//basedir'); test('///'); test('//'); test('/'); test('');
Output for git.master, git.master_jit
Testing: /dir/anotherdir/basedir// string(0) "" string(0) "" Testing: /dir/anotherdir/basedir/ string(7) "basedir" string(7) "basedir" Testing: /dir/anotherdir/basedir string(7) "basedir" string(7) "basedir" Testing: /dir/anotherdir//basedir string(7) "basedir" string(7) "basedir" Testing: /// string(0) "" string(0) "" Testing: // string(0) "" string(1) "/" Testing: / string(0) "" string(1) "/" Testing: string(0) "" string(0) ""
Output for rfc.property-hooks
Testing: /dir/anotherdir/basedir// string(7) "basedir" string(7) "basedir" Testing: /dir/anotherdir/basedir/ string(7) "basedir" string(7) "basedir" Testing: /dir/anotherdir/basedir string(7) "basedir" string(7) "basedir" Testing: /dir/anotherdir//basedir string(7) "basedir" string(7) "basedir" Testing: /// string(0) "" string(1) "/" Testing: // string(0) "" string(1) "/" Testing: / string(0) "" string(1) "/" Testing: string(0) "" string(0) ""

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:
67.54 ms | 408 KiB | 5 Q