3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ExecutionFailureBuilder { public function build(\Throwable $execption): ExecutionFailureInterface { } public static function flattenExceptionBacktrace(\Throwable $throwable) { $flatten = function(&$value, $key) { if ($value instanceof \Closure) { $closureReflection = new \ReflectionFunction($value); $value = sprintf( '(Closure at %s:%s)', $closureReflection->getFileName(), $closureReflection->getStartLine() ); } elseif (is_object($value)) { $value = sprintf('object(%s)', get_class($value)); } elseif (is_resource($value)) { $value = sprintf('resource(%s)', get_resource_type($value)); } }; do { $trace = $throwable->getTrace(); foreach ($trace as &$call) { array_walk_recursive($call['args'], $flatten); } var_dump($trace); } while($throwable = $throwable->getPrevious()); } } $a = function($b, string $c) { try { throw new Exception(); } catch (Exception $e) { ExecutionFailureBuilder::flattenExceptionBacktrace($e); } }; $b = new class(4, 'rfvtgb') { public function __construct($b, string $c) { try { throw new Exception(); } catch (Exception $e) { ExecutionFailureBuilder::flattenExceptionBacktrace($e); } } }; class Testing { public static function test($b, string $c) { try { throw new Exception(); } catch (Exception $e) { ExecutionFailureBuilder::flattenExceptionBacktrace($e); } } }; $a(3, 'RTYuio', new \stdClass, []); Testing::test(5, 'rfv');

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.0100.01318.39
8.3.50.0150.00617.91
8.3.40.0060.01018.91
8.3.30.0150.00618.83
8.3.20.0060.01320.22
8.3.10.0080.00023.48
8.3.00.0080.00019.68
8.2.180.0090.00618.50
8.2.170.0110.00422.96
8.2.160.0060.00922.25
8.2.150.0090.00924.18
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0080.00019.75
8.2.110.0060.00320.40
8.2.100.0080.00419.70
8.2.90.0040.00417.97
8.2.80.0040.00420.35
8.2.70.0040.00418.03
8.2.60.0030.00618.05
8.2.50.0080.00018.16
8.2.40.0000.00820.65
8.2.30.0000.01019.38
8.2.20.0070.00018.03
8.2.10.0040.00418.07
8.2.00.0040.00418.21
8.1.280.0070.01425.92
8.1.270.0090.00020.28
8.1.260.0030.00526.35
8.1.250.0000.00828.09
8.1.240.0000.01018.93
8.1.230.0070.00420.89
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0120.00017.25
8.1.190.0000.00819.44
8.1.180.0030.00518.10
8.1.170.0050.00318.49
8.1.160.0050.00318.93
8.1.150.0040.00420.29
8.1.140.0080.00017.72
8.1.130.0030.00318.90
8.1.120.0050.00317.39
8.1.110.0000.00817.47
8.1.100.0050.00317.56
8.1.90.0000.00817.34
8.1.80.0020.00517.48
8.1.70.0050.00517.49
8.1.60.0040.00417.50
8.1.50.0050.00317.46
8.1.40.0000.00817.57
8.1.30.0000.00817.61
8.1.20.0060.00317.70
8.1.10.0030.00617.62
8.1.00.0040.00417.48
8.0.300.0070.00020.04
8.0.290.0080.00016.88
8.0.280.0040.00418.40
8.0.270.0030.00617.19
8.0.260.0000.00816.89
8.0.250.0020.00617.06
8.0.240.0080.00016.94
8.0.230.0030.00617.02
8.0.220.0040.00416.93
8.0.210.0030.00316.84
8.0.200.0030.00317.00
8.0.190.0100.00016.93
8.0.180.0000.00817.04
8.0.170.0040.00416.95
8.0.160.0000.00916.91
8.0.150.0040.00416.91
8.0.140.0000.00816.86
8.0.130.0030.00313.38
8.0.120.0080.00016.85
8.0.110.0000.00716.78
8.0.100.0090.00016.84
8.0.90.0050.00317.02
8.0.80.0070.01116.93
8.0.70.0030.00516.99
8.0.60.0040.00417.02
8.0.50.0080.00016.95
8.0.30.0110.00817.18
8.0.20.0150.01117.40
8.0.10.0040.00416.95
8.0.00.0070.01216.92
7.4.330.0050.00015.55
7.4.320.0000.00616.55
7.4.300.0030.00316.44
7.4.290.0050.00216.59
7.4.280.0100.00016.48
7.4.270.0030.00616.63
7.4.260.0000.00816.53
7.4.250.0040.00416.43
7.4.240.0000.00816.58
7.4.230.0050.00216.63
7.4.220.0080.00016.72
7.4.210.0090.00616.60
7.4.200.0030.00316.46
7.4.160.0090.00916.42
7.4.150.0180.00717.40
7.4.140.0090.01017.86
7.4.130.0130.01016.55
7.4.120.0130.00816.50
7.4.110.0070.01016.75
7.4.100.0090.00916.66
7.4.90.0160.00516.62
7.4.80.0070.01019.39
7.4.70.0160.00316.32
7.4.60.0060.00916.72
7.4.50.0060.00616.55
7.4.40.0120.00616.51
7.4.00.0030.01315.06
7.3.330.0050.00013.32
7.3.320.0030.00313.27
7.3.310.0000.00716.49
7.3.300.0030.00316.47
7.3.290.0040.00416.31
7.3.280.0090.00616.43
7.3.270.0130.00617.40
7.3.260.0100.01016.52
7.3.250.0090.01016.51
7.3.240.0130.00816.52
7.3.230.0090.01016.55
7.3.210.0090.00916.46
7.3.200.0080.01216.45
7.3.190.0070.01116.48
7.3.180.0080.00916.47
7.3.170.0100.00816.47
7.3.160.0130.01016.40
7.2.330.0120.01216.66
7.2.320.0060.01116.83
7.2.310.0060.01216.46
7.2.300.0090.01216.64
7.2.290.0110.00816.90
7.2.110.0000.01316.57
7.2.60.0150.00817.07
7.2.20.0060.00919.96
7.2.10.0080.01220.02
7.2.00.0070.00719.71
7.1.200.0050.00215.69
7.1.140.0070.01118.86
7.1.130.0070.00718.91
7.1.120.0050.01318.44
7.1.110.0120.00317.97
7.1.100.0070.00718.14
7.1.90.0000.01317.86
7.1.80.0090.00917.74
7.1.70.0060.00616.82
7.1.60.0210.01434.81
7.1.50.0220.01334.83
7.1.40.0210.01534.43
7.1.30.0180.00934.50
7.1.20.0180.01134.61
7.1.10.0070.01116.64
7.1.00.0070.00716.83

preferences:
55.36 ms | 401 KiB | 5 Q