3v4l.org

run code in 300+ PHP versions simultaneously
<?php function converTo($date, $format = 'Y-m-d', $default = null, callable $funcExc = null ) { if (empty($date)) { return $default; } if (!is_string($format)) { throw new \InvalidArgumentException("Неверный формат"); } try { if (!($date instanceof \DateTime)) { if (is_numeric($date) && ( strlen($timestamp) == 13 || strlen($timestamp) == 10 )) { $date = new \DateTime("@" . $date); } elseif (strtotime($date) !== false) { $date = new \DateTime("@" . strtotime($date)); } else { $date = new \DateTime($date); } } if(!($date = $date->format($format))) { throw new \InvalidArgumentException("Произошла ошибка при приведению к заданному формату: " . $format); } } catch (\Exception $e) { if ($funcExc !== null) { call_user_func($funcExc, $date); } throw $e; } return $date; } var_dump(converTo("23/02/2013")); die; abstract class T { static public $instanses; final private function __construct(){ } public static function getInstance() { if (!(static::$instanses instanceof static)) { static::$instanses = new static; } return static::$instanses; } } class A extends T { static public $instanses; } class B extends A { static public $instanses; } $t = A::getInstance(); var_dump($t); $t1 = B::getInstance(); var_dump($t1); new B(); ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0150.00016.88
8.3.50.0190.01122.07
8.3.40.0070.01019.20
8.3.30.0160.00018.95
8.3.20.0000.00820.35
8.3.10.0040.00423.66
8.3.00.0050.00320.09
8.2.180.0060.00916.88
8.2.170.0090.00622.96
8.2.160.0140.00020.38
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00919.45
8.2.120.0050.00326.35
8.2.110.0060.00320.34
8.2.100.0140.00617.74
8.2.90.0000.00818.99
8.2.80.0060.00317.97
8.2.70.0000.00917.88
8.2.60.0000.00917.93
8.2.50.0000.00818.07
8.2.40.0090.00022.10
8.2.30.0000.00720.74
8.2.20.0040.00418.00
8.2.10.0000.00718.18
8.2.00.0040.00418.23
8.1.280.0040.01525.92
8.1.270.0090.00020.33
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0030.00723.91
8.1.230.0040.00722.22
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0060.00317.60
8.1.190.0040.00417.60
8.1.180.0070.00318.10
8.1.170.0090.00318.88
8.1.160.0000.00720.79
8.1.150.0040.00419.05
8.1.140.0000.00819.62
8.1.130.0030.00517.67
8.1.120.0020.00517.76
8.1.110.0070.00017.68
8.1.100.0050.00217.66
8.1.90.0000.00717.67
8.1.80.0070.00017.62
8.1.70.0040.00417.68
8.1.60.0080.00017.68
8.1.50.0060.00317.61
8.1.40.0060.00317.66
8.1.30.0100.00317.79
8.1.20.0040.00417.76
8.1.10.0080.00017.76
8.1.00.0050.00317.59
8.0.300.0070.00018.77
8.0.290.0070.00017.00
8.0.280.0000.00718.45
8.0.270.0030.00317.43
8.0.260.0000.00717.38
8.0.250.0030.00317.32
8.0.240.0030.00317.19
8.0.230.0030.00317.22
8.0.220.0000.00717.10
8.0.210.0040.00417.09
8.0.200.0000.00717.28
8.0.190.0030.00617.17
8.0.180.0000.00717.11
8.0.170.0040.00417.25
8.0.160.0030.00617.30
8.0.150.0100.00017.17
8.0.140.0030.00517.17
8.0.130.0050.00013.56
8.0.120.0040.00417.13
8.0.110.0070.00017.11
8.0.100.0030.00517.21
8.0.90.0000.00817.01
8.0.80.0120.00917.25
8.0.70.0000.00717.04
8.0.60.0000.00717.11
8.0.50.0000.00817.15
8.0.30.0040.01517.35
8.0.20.0140.00717.45
8.0.10.0000.00717.36
8.0.00.0080.01216.99
7.4.330.0020.00216.77
7.4.320.0070.00016.73
7.4.300.0000.00716.70
7.4.290.0040.00416.71
7.4.280.0030.00616.60
7.4.270.0030.00716.73
7.4.260.0030.00616.61
7.4.250.0040.00416.80
7.4.240.0040.00416.66
7.4.230.0030.00316.70
7.4.220.0030.02416.83
7.4.210.0120.00516.76
7.4.200.0070.00016.45
7.4.160.0060.00916.90
7.4.150.0160.00317.40
7.4.140.0150.01117.86
7.4.130.0100.00716.71
7.4.120.0070.01016.74
7.4.110.0030.01316.74
7.4.100.0090.01316.74
7.4.90.0120.00416.84
7.4.80.0110.00719.39
7.4.70.0140.00316.71
7.4.60.0090.00616.85
7.4.50.0100.00716.83
7.4.40.0100.00716.80
7.4.30.0090.00916.67
7.4.00.0130.00315.18
7.3.330.0050.00013.44
7.3.320.0030.00313.50
7.3.310.0040.00416.44
7.3.300.0000.00716.63
7.3.290.0040.00216.41
7.3.280.0070.01016.59
7.3.270.0130.00317.40
7.3.260.0120.01216.66
7.3.250.0080.01116.69
7.3.240.0100.00716.80
7.3.230.0150.00916.64
7.3.210.0100.00716.54
7.3.200.0170.00016.82
7.3.190.0150.00916.62
7.3.180.0130.00316.60
7.3.170.0170.00016.62
7.3.160.0000.01616.85
7.2.330.0040.01416.64
7.2.320.0090.00916.83
7.2.310.0110.00616.99
7.2.300.0080.00916.93
7.2.290.0180.00016.88
7.2.60.0030.01017.00
7.2.00.0030.00919.59
7.1.200.0030.01015.91
7.1.100.0000.00918.28
7.1.70.0040.00417.37
7.1.60.0000.02219.13
7.1.50.0100.01317.13
7.1.00.0100.06722.36
7.0.200.0030.00517.05
7.0.60.0130.06020.07
7.0.50.0030.07717.88
7.0.40.0030.04320.05
7.0.30.0270.04320.10
7.0.20.0330.05320.08
7.0.10.0000.10020.16
7.0.00.0100.03720.11
5.6.280.0030.06720.93
5.6.210.0100.08320.52
5.6.200.0030.08018.11
5.6.190.0070.04320.55
5.6.180.0370.07320.63
5.6.170.0170.04320.44
5.6.160.0030.05320.54
5.6.150.0030.04018.14
5.6.140.0030.04018.18
5.6.130.0100.07718.15
5.6.120.0100.07721.14
5.6.110.0000.04721.00
5.6.100.0030.04721.01
5.6.90.0100.07721.00
5.6.80.0170.06320.43
5.5.350.0170.04020.32
5.5.340.0030.06318.02
5.5.330.0030.07020.31
5.5.320.0300.07020.30
5.5.310.0230.07720.31
5.5.300.0030.05318.08
5.5.290.0070.06318.02
5.5.280.0030.07020.95
5.5.270.0070.05020.99
5.5.260.0030.08020.88
5.5.250.0100.07720.70
5.5.240.0170.06720.13

preferences:
54.92 ms | 401 KiB | 5 Q