3v4l.org

run code in 300+ PHP versions simultaneously
<?php class asset { protected $id; function __construct($id) { $this->id = $id; } function getId() { return $this->id; } } $getIdsCode = 'array_map(array($this, $this->getId),$input)'; // UPDATE THIS if (strpos($getIdsCode, ';') !== false) die('code should not contain ; !'); $getIdsCode = preg_replace('/\s+/', '', $getIdsCode); echo 'code length '.strlen($getIdsCode)."\n"; $input = array(new asset(10),new asset(20),new asset(30)); echo eval("return $getIdsCode;") . "\n"; $input = array(new asset(40),new asset(50),new asset(60)); echo eval("return $getIdsCode;") . "\n"; ?>

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.0140.00416.63
8.3.50.0150.00523.06
8.3.40.0040.01119.21
8.3.30.0130.00319.09
8.3.20.0070.00020.16
8.3.10.0070.00023.60
8.3.00.0080.00019.50
8.2.180.0050.00818.64
8.2.170.0130.00722.96
8.2.160.0090.00620.45
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.01426.16
8.2.120.0050.00320.85
8.2.110.0060.00322.11
8.2.100.0060.00619.77
8.2.90.0050.00319.07
8.2.80.0040.00417.97
8.2.70.0030.00517.75
8.2.60.0090.00017.80
8.2.50.0030.00618.07
8.2.40.0000.00819.82
8.2.30.0000.00718.02
8.2.20.0030.00617.97
8.2.10.0040.00418.14
8.2.00.0070.00017.89
8.1.280.0040.01925.92
8.1.270.0060.00323.91
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0030.00623.79
8.1.230.0110.00019.07
8.1.220.0040.00417.79
8.1.210.0080.00018.77
8.1.200.0060.00317.38
8.1.190.0030.00517.36
8.1.180.0040.00418.10
8.1.170.0050.00318.78
8.1.160.0040.00422.01
8.1.150.0000.00918.93
8.1.140.0030.00617.66
8.1.130.0030.00317.88
8.1.120.0070.00017.52
8.1.110.0040.00417.51
8.1.100.0040.00417.63
8.1.90.0070.00017.53
8.1.80.0000.00817.66
8.1.70.0000.00717.56
8.1.60.0030.00617.70
8.1.50.0000.00917.72
8.1.40.0040.00417.63
8.1.30.0030.00617.71
8.1.20.0040.00417.69
8.1.10.0090.00017.63
8.1.00.0070.00017.72
8.0.300.0060.00318.77
8.0.290.0040.00417.00
8.0.280.0000.00718.59
8.0.270.0000.00717.36
8.0.260.0030.00317.23
8.0.250.0000.00717.20
8.0.240.0030.00817.20
8.0.230.0040.00417.15
8.0.220.0030.00317.07
8.0.210.0040.00417.02
8.0.200.0050.00217.07
8.0.190.0000.00717.08
8.0.180.0040.00417.07
8.0.170.0080.00017.15
8.0.160.0040.00417.08
8.0.150.0030.00316.98
8.0.140.0000.00717.02
8.0.130.0000.00713.52
8.0.120.0000.00817.09
8.0.110.0040.00416.98
8.0.100.0030.00617.22
8.0.90.0040.00416.97
8.0.80.0140.00417.11
8.0.70.0050.00217.16
8.0.60.0040.00417.14
8.0.50.0040.00417.00
8.0.30.0100.00917.29
8.0.20.0110.00717.40
8.0.10.0070.00017.18
8.0.00.0140.00716.90
7.4.330.0050.00015.17
7.4.320.0030.00316.84
7.4.300.0000.00716.87
7.4.290.0000.00716.82
7.4.280.0040.00416.73
7.4.270.0000.00716.88
7.4.260.0060.00316.85
7.4.250.0000.00816.85
7.4.240.0010.00616.68
7.4.230.0070.00016.66
7.4.220.0150.00316.91
7.4.210.0040.01116.76
7.4.200.0000.00716.75
7.4.160.0030.01316.61
7.4.150.0140.00617.40
7.4.140.0100.00717.86
7.4.130.0080.00816.68
7.4.120.0090.00816.68
7.4.110.0050.01316.65
7.4.100.0160.00616.73
7.4.90.0200.00316.91
7.4.80.0090.00919.39
7.4.70.0080.00816.71
7.4.60.0030.01516.75
7.4.50.0000.00716.69
7.4.40.0070.01016.88
7.4.30.0090.00616.71
7.4.00.0110.00515.04
7.3.330.0070.00013.60
7.3.320.0030.00313.55
7.3.310.0040.00416.69
7.3.300.0040.00416.46
7.3.290.0090.01216.59
7.3.280.0100.00916.58
7.3.270.0150.00417.40
7.3.260.0060.01216.81
7.3.250.0110.00616.71
7.3.240.0150.00316.59
7.3.230.0070.01116.52
7.3.210.0130.00316.66
7.3.200.0070.01019.39
7.3.190.0000.01616.65
7.3.180.0090.00616.77
7.3.170.0090.00616.79
7.3.160.0100.01016.89
7.3.120.0100.01015.05
7.3.110.0130.00314.87
7.3.100.0070.00715.25
7.3.90.0060.00915.18
7.3.80.0070.00414.98
7.3.70.0050.00515.04
7.3.60.0090.00615.21
7.3.50.0060.00914.77
7.3.40.0040.01414.77
7.3.30.0080.00415.09
7.3.20.0140.00317.04
7.3.10.0120.00616.89
7.3.00.0070.00416.67
7.2.330.0140.00517.00
7.2.320.0100.01416.97
7.2.310.0110.00817.01
7.2.300.0060.01016.93
7.2.290.0110.00716.89
7.2.250.0040.01115.34
7.2.240.0060.01315.00
7.2.230.0000.01515.31
7.2.220.0040.01115.00
7.2.210.0070.01015.14
7.2.200.0060.00915.09
7.2.190.0070.01015.27
7.2.180.0170.00015.43
7.2.170.0040.01415.18
7.2.60.0060.00917.13
7.2.00.0040.00819.79
7.1.330.0000.01715.94
7.1.320.0000.01415.81
7.1.310.0100.00315.82
7.1.300.0100.00716.16
7.1.290.0100.00316.14
7.1.280.0000.01116.03
7.1.270.0070.00716.01
7.1.260.0070.00715.71
7.1.200.0080.00015.84
7.1.100.0060.00618.39
7.1.70.0030.00517.30
7.1.60.0070.01719.46
7.1.50.0070.00717.27
7.1.00.0000.07722.37
7.0.200.0040.00416.65
7.0.140.0100.06722.13
7.0.110.0100.03719.97
7.0.100.0100.07019.95
7.0.90.0070.04720.05
7.0.80.0130.07719.93
7.0.70.0130.05719.95
7.0.60.0170.07319.66
7.0.50.0070.09020.11
7.0.40.0070.07319.64
7.0.30.0170.04319.70
7.0.20.0100.05319.78
7.0.10.0000.04319.74
7.0.00.0070.03719.81
5.6.280.0030.07320.96
5.6.260.0130.05720.51
5.6.250.0100.05320.65
5.6.240.0100.04720.87
5.6.230.0070.06320.58
5.6.220.0100.07720.55
5.6.210.0100.08720.64
5.6.200.0030.08320.86
5.6.190.0100.08320.62
5.6.180.0100.07320.60
5.6.170.0000.04320.64
5.6.160.0030.04320.72
5.6.150.0030.04320.46
5.6.140.0070.04320.70
5.6.130.0000.04320.55
5.6.120.0070.06320.63
5.6.110.0030.05020.64
5.6.100.0130.05720.55
5.6.90.0030.04720.63
5.6.80.0000.08719.86
5.6.70.0030.04019.99
5.6.60.0000.08019.94
5.6.50.0070.04020.03
5.6.40.0130.03720.00
5.6.30.0100.03320.06
5.6.20.0130.05720.00
5.6.10.0100.07319.84
5.6.00.0070.07720.00
5.5.380.0070.07717.70
5.5.370.0030.06317.47
5.5.360.0070.06317.69
5.5.350.0070.04317.77
5.5.340.0070.08317.92
5.5.330.0070.07317.89
5.5.320.0100.03318.10
5.5.310.0000.04318.22
5.5.300.0070.03718.23
5.5.290.0070.06018.09
5.5.280.0100.03017.93
5.5.270.0030.04318.09
5.5.260.0100.03018.21
5.5.250.0070.06717.74
5.5.240.0000.03717.30
5.5.230.0000.04317.35
5.5.220.0100.05317.47
5.5.210.0100.04017.60
5.5.200.0070.05717.45
5.5.190.0070.06017.40
5.5.180.0070.05717.59
5.5.160.0070.07017.44
5.5.150.0100.07017.57
5.5.140.0070.07317.18
5.5.130.0030.04317.18
5.5.120.0100.05717.21
5.5.110.0070.04317.25
5.5.100.0070.05017.35
5.5.90.0100.05717.34
5.5.80.0000.04017.18
5.5.70.0000.05317.34
5.5.60.0070.06717.15
5.5.50.0000.04317.34
5.5.40.0070.08017.15
5.5.30.0070.04717.33
5.5.20.0070.07717.34
5.5.10.0030.03317.15
5.5.00.0070.06317.36
5.4.450.0030.04019.34
5.4.440.0100.05719.41
5.4.430.0070.03719.32
5.4.420.0070.07719.41
5.4.410.0070.07319.45
5.4.400.0030.07719.23
5.4.390.0230.05719.22
5.4.380.0070.04719.01
5.4.370.0030.05319.01
5.4.360.0100.03319.16
5.4.350.0100.03719.18
5.4.340.0100.06319.08
5.4.320.0100.07018.95
5.4.310.0070.07719.01
5.4.300.0030.07719.33
5.4.290.0100.05718.94
5.4.280.0030.04019.22
5.4.270.0100.06019.01
5.4.260.0000.04319.19
5.4.250.0030.03719.17
5.4.240.0070.09019.02
5.4.230.0030.04018.96
5.4.220.0030.03719.16
5.4.210.0100.05319.18
5.4.200.0100.04719.00
5.4.190.0000.07719.11
5.4.180.0000.05318.99
5.4.170.0030.04318.97
5.4.160.0130.05019.08
5.4.150.0070.06018.92
5.4.140.0100.05016.50
5.4.130.0000.05016.50
5.4.120.0130.05016.33
5.4.110.0000.03716.55
5.4.100.0100.03016.47
5.4.90.0070.03316.43
5.4.80.0070.03716.63
5.4.70.0070.07716.52
5.4.60.0000.03716.36
5.4.50.0000.03316.39
5.4.40.0100.06716.54
5.4.30.0030.03716.52
5.4.20.0030.03716.22
5.4.10.0030.06316.24
5.4.00.0000.06015.93
5.3.290.0100.05714.82
5.3.280.0000.04014.83
5.3.270.0130.03014.65
5.3.260.0070.07014.74
5.3.250.0100.06714.47
5.3.240.0070.06714.57
5.3.230.0000.04014.83
5.3.220.0030.05314.58
5.3.210.0070.03314.65
5.3.200.0100.03014.68
5.3.190.0070.03714.59
5.3.180.0100.04014.70
5.3.170.0030.04714.60
5.3.160.0030.05014.63
5.3.150.0000.05014.61
5.3.140.0070.03014.54
5.3.130.0030.08014.64
5.3.120.0000.06014.42
5.3.110.0030.07714.79
5.3.100.0100.06714.02
5.3.90.0070.07014.17
5.3.80.0100.07314.04
5.3.70.0030.07014.03
5.3.60.0070.06714.02
5.3.50.0000.04013.93
5.3.40.0100.02714.18
5.3.30.0030.05314.00
5.3.20.0030.06313.92
5.3.10.0030.03013.75
5.3.00.0030.04013.70
5.2.170.0000.03011.95
5.2.160.0070.02311.95
5.2.150.0030.05711.95
5.2.140.0070.04711.95
5.2.130.0000.06011.95
5.2.120.0000.03311.95
5.2.110.0000.02711.95
5.2.100.0000.02711.95
5.2.90.0070.02311.95
5.2.80.0030.06011.95
5.2.70.0030.06011.95
5.2.60.0070.05711.95
5.2.50.0030.04011.95
5.2.40.0000.03311.95
5.2.30.0030.04011.95
5.2.20.0070.05711.95
5.2.10.0000.05311.95
5.2.00.0000.03011.95
5.1.60.0070.02711.95
5.1.50.0100.04711.95
5.1.40.0030.05311.95
5.1.30.0030.06011.95
5.1.20.0100.05011.95
5.1.10.0000.06011.95
5.1.00.0000.06011.95
5.0.50.0070.03711.95
5.0.40.0000.04711.95
5.0.30.0030.05011.95
5.0.20.0030.02711.95
5.0.10.0000.04311.95
5.0.00.0030.06011.95
4.4.90.0000.03011.95
4.4.80.0070.03011.95
4.4.70.0000.01711.95
4.4.60.0000.01311.95
4.4.50.0000.02311.95
4.4.40.0000.02311.95
4.4.30.0070.03311.95
4.4.20.0070.02711.95
4.4.10.0000.03011.95
4.4.00.0030.06011.95
4.3.110.0030.01711.95
4.3.100.0000.03311.95
4.3.90.0000.04011.95
4.3.80.0070.03311.95
4.3.70.0030.03011.95
4.3.60.0070.03711.95
4.3.50.0030.02311.95
4.3.40.0030.02711.95
4.3.30.0000.02011.95
4.3.20.0000.03711.95
4.3.10.0000.03711.95
4.3.00.0000.03011.95

preferences:
50.49 ms | 400 KiB | 5 Q