3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filenameNew = 'PX20170713_103320_2651093_00001'; $filenameOld = '5956e5781e4f1-20170630_233347_5712837_00001'; $timeslug = implode(array_slice(explode('_', rtrim(basename($fileToProcess), ".xml" )), 0, 2)); $datetime = date('c', strtotime($timeslug)); function getDateFromFilename(string $filename): \DateTime { return new \DateTime(); } var_dump(getDateFromFilename($filenameOld));
Output for git.master
Warning: Undefined variable $fileToProcess in /in/Q9bQd on line 6 Deprecated: basename(): Passing null to parameter #1 ($path) of type string is deprecated in /in/Q9bQd on line 6 object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-13 15:47:50.003496" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for git.master_jit
Warning: Undefined variable $fileToProcess in /in/Q9bQd on line 6 Deprecated: basename(): Passing null to parameter #1 ($path) of type string is deprecated in /in/Q9bQd on line 6 object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-13 15:47:50.003807" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for rfc.property-hooks
Warning: Undefined variable $fileToProcess in /in/Q9bQd on line 6 Deprecated: basename(): Passing null to parameter #1 ($path) of type string is deprecated in /in/Q9bQd on line 6 object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-13 15:47:50.003595" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }

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:
43.57 ms | 401 KiB | 8 Q