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 (is_string($date) && (strtotime($date) !== false)) { $date = new \DateTime("@" . strtotime($date)); } elseif(is_string($date)) { $date = new \DateTime($date); } else { throw new \InvalidArgumentException("Не удалось распознать формат входящей даты"); } } if(!($date = $date->format($format))) { throw new \InvalidArgumentException("Произошла ошибка при приведению к заданному формату: " . $format); } } catch (\Exception $e) { if ($funcExc !== null) { call_user_func($funcExc, $date); } throw $e; } return $date->format($format) ; } var_dump(converTo(['asda'])); 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.0110.00716.63
8.3.50.0100.01021.93
8.3.40.0130.00318.85
8.3.30.0040.01118.86
8.3.20.0080.00020.34
8.3.10.0080.00023.56
8.3.00.0000.00819.91
8.2.180.0110.00416.63
8.2.170.0090.00622.96
8.2.160.0090.00920.57
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0110.00019.38
8.2.120.0040.00426.35
8.2.110.0090.00021.05
8.2.100.0040.00818.03
8.2.90.0040.00419.09
8.2.80.0000.00817.97
8.2.70.0000.01017.50
8.2.60.0130.00017.49
8.2.50.0030.00618.07
8.2.40.0030.00520.94
8.2.30.0020.00520.55
8.2.20.0000.00717.65
8.2.10.0040.00417.90
8.2.00.0030.00518.01
8.1.280.0100.00325.92
8.1.270.0040.00420.20
8.1.260.0080.00028.09
8.1.250.0050.00328.09
8.1.240.0060.00322.74
8.1.230.0080.00317.76
8.1.220.0050.00317.74
8.1.210.0060.00318.77
8.1.200.0000.00917.25
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0040.00418.68
8.1.160.0070.00020.69
8.1.150.0040.00418.86
8.1.140.0030.00619.59
8.1.130.0000.00717.73
8.1.120.0000.00717.40
8.1.110.0050.00217.52
8.1.100.0040.00417.48
8.1.90.0080.00017.36
8.1.80.0000.00817.54
8.1.70.0000.00817.46
8.1.60.0000.00717.61
8.1.50.0000.00917.50
8.1.40.0000.00817.56
8.1.30.0060.00317.57
8.1.20.0070.00017.65
8.1.10.0060.00317.54
8.1.00.0000.00717.53
8.0.300.0000.00818.77
8.0.290.0040.00416.88
8.0.280.0070.00018.48
8.0.270.0050.00317.33
8.0.260.0030.00317.28
8.0.250.0070.00016.94
8.0.240.0040.00417.05
8.0.230.0000.00716.96
8.0.220.0000.00816.99
8.0.210.0020.00516.95
8.0.200.0030.00317.03
8.0.190.0000.00716.92
8.0.180.0000.00816.94
8.0.170.0030.00616.93
8.0.160.0030.00517.01
8.0.150.0040.00416.91
8.0.140.0040.00416.95
8.0.130.0050.00313.47
8.0.120.0080.00016.95
8.0.110.0020.00517.05
8.0.100.0050.00216.99
8.0.90.0040.00417.03
8.0.80.0100.00716.96
8.0.70.0040.00416.90
8.0.60.0040.00416.93
8.0.50.0000.00717.00
8.0.30.0150.00717.09
8.0.20.0100.00917.40
8.0.10.0050.00217.11
8.0.00.0060.01116.86
7.4.330.0000.00516.84
7.4.320.0060.00016.54
7.4.300.0030.00316.63
7.4.290.0000.00716.68
7.4.280.0000.00916.54
7.4.270.0070.00316.56
7.4.260.0040.00516.63
7.4.250.0050.00216.51
7.4.240.0030.00416.54
7.4.230.0000.00716.72
7.4.220.0100.01916.55
7.4.210.0040.01116.45
7.4.200.0070.00016.57
7.4.160.0160.00016.52
7.4.150.0060.01217.40
7.4.140.0170.00817.86
7.4.130.0070.01216.66
7.4.120.0120.00516.61
7.4.110.0150.00316.59
7.4.100.0110.00816.65
7.4.90.0110.00616.52
7.4.80.0090.01419.39
7.4.70.0100.00716.52
7.4.60.0120.00416.60
7.4.50.0060.01016.43
7.4.40.0030.01416.47
7.4.30.0080.00816.54
7.4.00.0000.01115.06
7.3.330.0060.00013.40
7.3.320.0030.00313.28
7.3.310.0030.00516.34
7.3.300.0030.00316.42
7.3.290.0070.00716.46
7.3.280.0080.00916.44
7.3.270.0150.00317.40
7.3.260.0120.00616.43
7.3.250.0080.01116.54
7.3.240.0080.00916.56
7.3.230.0110.00716.57
7.3.210.0100.00716.49
7.3.200.0120.00316.38
7.3.190.0280.02016.38
7.3.180.0130.00316.47
7.3.170.0140.00316.51
7.3.160.0080.00816.50
7.2.330.0060.01316.57
7.2.320.0180.00616.57
7.2.310.0000.01616.65
7.2.300.0100.00616.79
7.2.290.0160.00316.67
7.2.60.0030.01216.80
7.2.00.0000.01819.26
7.1.200.0080.00415.75
7.1.100.0050.00518.05
7.1.70.0050.00316.92
7.1.60.0100.01019.13
7.1.50.0040.00816.87
7.1.00.0070.07022.45
7.0.200.0000.00816.64
7.0.60.0000.04320.11
7.0.50.0100.05017.93
7.0.40.0100.06320.10
7.0.30.0230.04320.06
7.0.20.0330.07720.21
7.0.10.0000.05020.10
7.0.00.0130.03720.05
5.6.280.0030.05720.84
5.6.210.0070.07320.64
5.6.200.0030.04018.18
5.6.190.0070.04020.63
5.6.180.0270.07720.60
5.6.170.0200.03720.47
5.6.160.0130.08020.47
5.6.150.0000.04318.19
5.6.140.0170.07318.14
5.6.130.0130.08018.18
5.6.120.0070.08021.02
5.6.110.0030.07720.98
5.6.100.0070.05021.03
5.6.90.0130.05021.04
5.6.80.0030.05320.55
5.5.350.0170.04020.45
5.5.340.0070.05318.02
5.5.330.0170.04720.27
5.5.320.0170.08320.25
5.5.310.0100.04720.27
5.5.300.0030.04317.96
5.5.290.0030.08318.02
5.5.280.0170.08020.70
5.5.270.0130.03720.97
5.5.260.0070.07320.90
5.5.250.0100.08020.50
5.5.240.0130.08320.28

preferences:
46.24 ms | 401 KiB | 5 Q