3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $name; public $lastName; private $methods = array(); public function __construct($namae,$myozi) { $this->name = $namae; $this->lastName = $myozi; } function method() { return print "姓:".$this->lastName."名:".$this->name; } public function registerMethod($name, Closure $method) { $this->methods[$name] = $method; } public function __call($name, $arguments) { if (array_key_exists($name, $this->methods)) { $this->methods[$name](); } else { throw new BadMethodCallException('No such method: ' . $name); } } } $test = new Test("太郎","田中"); $test->registerMethod( 'aaaa', function() { print 'aaaa'; } ); $test->aaaa(); $test->bbbb();

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.4.120.0140.00624.01
8.4.110.0120.00818.23
8.4.100.0100.01018.98
8.4.90.0090.01120.66
8.4.80.0060.00418.63
8.4.70.0140.00819.95
8.4.60.0140.00718.84
8.4.50.0140.00618.09
8.4.40.0030.00619.48
8.4.30.0080.00017.61
8.4.20.0060.00319.98
8.4.10.0030.00619.53
8.3.250.0100.00918.91
8.3.240.0110.00816.96
8.3.230.0030.00616.78
8.3.220.0130.00619.22
8.3.210.0080.01018.62
8.3.200.0050.00416.77
8.3.190.0140.00418.78
8.3.180.0100.00916.58
8.3.170.0190.00019.06
8.3.160.0130.00317.26
8.3.150.0090.00917.00
8.3.140.0030.00619.07
8.3.130.0060.00916.62
8.3.120.0130.00318.93
8.3.110.0090.00020.94
8.3.100.0110.00724.06
8.3.90.0030.00626.77
8.3.80.0090.00319.36
8.3.70.0030.01218.55
8.3.60.0040.01116.75
8.3.50.0100.00517.36
8.3.40.0070.01018.93
8.3.30.0060.00918.59
8.3.20.0040.00421.91
8.3.10.0040.00421.89
8.3.00.0060.00319.79
8.2.290.0110.00720.43
8.2.280.0050.00420.10
8.2.270.0140.00417.50
8.2.260.0090.00916.80
8.2.250.0070.00016.76
8.2.240.0140.00717.10
8.2.230.0030.00722.58
8.2.220.0090.00037.54
8.2.210.0000.00826.77
8.2.200.0090.00018.88
8.2.190.0140.00717.00
8.2.180.0060.00918.53
8.2.170.0000.01422.96
8.2.160.0130.00320.38
8.2.150.0040.00424.18
8.2.140.0140.00424.66
8.2.130.0050.00220.52
8.2.120.0070.01026.35
8.2.110.0000.00920.38
8.2.100.0060.00617.91
8.2.90.0040.00419.11
8.2.80.0050.00317.97
8.2.70.0030.00617.63
8.2.60.0060.00318.05
8.2.50.0000.00818.10
8.2.40.0040.00420.50
8.2.30.0040.00419.48
8.2.20.0040.00418.09
8.2.10.0000.00818.17
8.2.00.0000.00818.13
8.1.330.0130.00421.74
8.1.320.0090.01116.25
8.1.310.0110.00316.85
8.1.300.0070.00718.56
8.1.290.0040.00430.84
8.1.280.0130.00325.92
8.1.270.0050.00320.64
8.1.260.0110.00726.35
8.1.250.0120.00628.09
8.1.240.0030.00922.13
8.1.230.0080.00418.87
8.1.220.0080.00017.76
8.1.210.0030.00518.77
8.1.200.0040.00417.35
8.1.190.0090.00017.13
8.1.180.0060.00618.10
8.1.170.0000.00818.66
8.1.160.0070.00019.03
8.1.150.0070.00018.96
8.1.140.0000.00719.59
8.1.130.0040.00418.87
8.1.120.0030.00317.50
8.1.110.0050.00217.43
8.1.100.0000.00717.49
8.1.90.0000.00817.33
8.1.80.0040.00417.42
8.1.70.0000.00817.47
8.1.60.0000.00817.60
8.1.50.0040.00417.50
8.1.40.0030.00617.43
8.1.30.0000.00817.68
8.1.20.0000.00817.55
8.1.10.0040.00417.64
8.1.00.0040.00417.52
8.0.300.0000.00819.84
8.0.290.0040.00416.75
8.0.280.0000.00718.46
8.0.270.0000.00717.35
8.0.260.0030.00319.04
8.0.250.0040.00416.95
8.0.240.0040.00417.03
8.0.230.0070.00017.07
8.0.220.0040.00416.98
8.0.210.0000.00716.99
8.0.200.0000.00617.04
8.0.190.0040.00417.04
8.0.180.0040.00416.84
8.0.170.0030.00316.90
8.0.160.0000.00716.83
8.0.150.0030.00516.96
8.0.140.0000.00716.94
8.0.130.0030.00313.43
8.0.120.0040.00416.94
8.0.110.0050.00216.86
8.0.100.0050.00217.04
8.0.90.0000.00716.76
8.0.80.0050.01316.97
8.0.70.0000.00817.04
8.0.60.0040.00416.96
8.0.50.0000.00716.84
8.0.30.0090.01017.30
8.0.20.0100.01017.40
8.0.10.0000.00717.05
8.0.00.0140.00716.93
7.4.330.0060.00015.55
7.4.320.0030.00316.54
7.4.300.0030.00316.68
7.4.290.0070.00016.60
7.4.280.0060.00316.65
7.4.270.0030.00316.64
7.4.260.0040.00416.61
7.4.250.0000.00816.63
7.4.240.0030.00316.52
7.4.230.0030.00516.72
7.4.220.0070.01716.66
7.4.210.0110.00416.66
7.4.200.0000.00716.64
7.4.160.0050.01116.49
7.4.150.0120.00617.40
7.4.140.0130.00817.86
7.4.130.0040.01316.53
7.4.120.0130.00916.58
7.4.110.0040.01416.56
7.4.100.0140.00516.72
7.4.90.0140.00516.58
7.4.80.0120.01219.39
7.4.70.0030.01316.57
7.4.60.0070.01016.58
7.4.50.0100.00616.43
7.4.40.0040.01216.38
7.4.30.0100.00716.50
7.4.00.0030.01415.10
7.3.330.0000.00513.38
7.3.320.0000.00513.45
7.3.310.0000.00716.35
7.3.300.0020.00516.46
7.3.290.0100.00516.46
7.3.280.0070.00916.45
7.3.270.0130.00717.40
7.3.260.0090.01216.52
7.3.250.0110.00916.46
7.3.240.0090.00816.47
7.3.230.0090.01116.54
7.3.210.0060.01816.54
7.3.200.0150.00616.58
7.3.190.0100.00716.66
7.3.180.0030.01316.44
7.3.170.0070.01016.52
7.3.160.0100.00716.37
7.3.10.0060.00616.82
7.3.00.0030.00716.75
7.2.330.0040.01416.71
7.2.320.0150.00316.70
7.2.310.0100.00616.80
7.2.300.0070.01616.64
7.2.290.0100.00716.76
7.2.130.0040.00716.84
7.2.120.0030.00616.97
7.2.110.0040.00416.91
7.2.100.0030.01216.84
7.2.90.0070.00717.09
7.2.80.0060.00616.86
7.2.70.0000.00916.79
7.2.60.0050.01016.91
7.2.50.0000.01016.94
7.2.40.0000.01316.86
7.2.30.0130.00316.79
7.2.20.0080.00016.92
7.2.10.0080.00416.91
7.2.00.0040.00717.04
7.1.250.0060.00315.95
7.1.200.0080.00415.90
7.1.70.0000.00717.21
7.1.60.1170.00733.05
7.1.50.0930.01732.97
7.1.40.0930.02332.46
7.1.30.1100.01332.52
7.1.20.0670.02732.60
7.1.10.0430.01314.84
7.1.00.0530.01014.68
7.0.200.0900.01314.87
7.0.190.1200.01014.79
7.0.180.0770.01014.40
7.0.170.0930.01714.33
7.0.160.0570.01314.32
7.0.150.0370.01014.39
7.0.140.0600.01314.48
7.0.130.0470.00714.73
7.0.120.0400.01314.40
7.0.110.0370.01714.37
7.0.100.0470.01014.45
7.0.90.0400.01714.40
7.0.80.0730.01314.61
7.0.70.0400.01014.57
7.0.60.0570.01314.22
7.0.50.1130.00714.43
7.0.40.0600.00714.60
7.0.30.0570.01314.50
7.0.20.0430.01014.68
7.0.10.0630.01314.54
7.0.00.0630.01314.53

preferences:
29.26 ms | 403 KiB | 5 Q