3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class FullName implements JsonSerializable { public $forename; public $surname; public function __construct(string $forename, string $surname) { $this->forename = $this->validateAndNormalize($forename); $this->surname = $this->validateAndNormalize($surname); } private function validateAndNormalize($name) : string { return ucwords($name); } public function jsonSerialize() { return $this->forename . ' ' . $this->surname; } } $o = new FullName('aaa', 'bbb'); $returnValues = array( 'id' => 42, 'name' => $o, 'message' => 'The professional has been updated' ); echo json_encode($returnValues);

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.5.10.0110.00616.59
8.5.00.0120.00819.96
8.4.150.0020.00014.05
8.4.140.0150.00717.48
8.4.130.0130.00817.96
8.4.120.0120.00820.79
8.4.110.0050.00722.61
8.4.100.0110.00918.99
8.4.90.0120.00818.67
8.4.80.0060.00317.88
8.4.70.0080.00817.71
8.4.60.0130.00818.74
8.4.50.0120.00918.13
8.4.40.0120.00819.44
8.4.30.0000.00817.77
8.4.20.0070.01420.64
8.4.10.0080.00020.70
8.3.280.0110.01320.08
8.3.270.0110.00916.59
8.3.260.0070.00216.82
8.3.250.0110.00918.75
8.3.240.0120.00720.66
8.3.230.0120.00816.67
8.3.220.0040.00319.23
8.3.210.0100.00816.64
8.3.200.0100.00916.97
8.3.190.0130.00817.36
8.3.180.0110.00916.59
8.3.170.0130.00617.28
8.3.160.0070.00016.77
8.3.150.0160.00318.85
8.3.140.0120.00316.72
8.3.130.0030.00618.57
8.3.120.0130.00620.71
8.3.110.0030.01216.60
8.3.100.0040.00424.06
8.3.90.0140.00016.75
8.3.80.0030.00718.68
8.3.70.0110.00716.61
8.3.60.0140.00018.68
8.3.50.0080.01018.11
8.3.40.0110.00418.86
8.3.30.0070.00718.84
8.3.20.0070.00020.85
8.3.10.0090.00021.78
8.3.00.0080.00021.69
8.2.290.0100.00920.60
8.2.280.0030.00720.37
8.2.270.0030.01217.36
8.2.260.0030.00518.86
8.2.250.0040.00418.33
8.2.240.0070.00317.11
8.2.230.0040.00420.94
8.2.220.0110.00037.54
8.2.210.0030.00726.77
8.2.200.0060.00318.29
8.2.190.0040.01116.58
8.2.180.0120.00316.99
8.2.170.0100.01022.96
8.2.160.0060.00920.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.00519.95
8.2.120.0000.00826.35
8.2.110.0060.00322.26
8.2.100.0120.00017.84
8.2.90.0050.00317.91
8.2.80.0090.00017.75
8.2.70.0030.00617.63
8.2.60.0090.00018.03
8.2.50.0000.00918.07
8.2.40.0030.00719.88
8.2.30.0060.00318.19
8.2.20.0000.00818.11
8.2.10.0040.00419.50
8.2.00.0040.00418.03
8.1.330.0070.00321.84
8.1.320.0140.00618.53
8.1.310.0120.00316.84
8.1.300.0060.00317.78
8.1.290.0070.00718.88
8.1.280.0070.01425.92
8.1.270.0000.00721.83
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0060.00322.59
8.1.230.0080.00421.03
8.1.220.0000.00817.79
8.1.210.0000.00819.10
8.1.200.0060.00317.48
8.1.190.0030.00617.35
8.1.180.0000.00818.10
8.1.170.0000.00918.66
8.1.160.0000.00818.80
8.1.150.0010.00818.52
8.1.140.0000.00819.01
8.1.130.0030.00320.16
8.1.120.0000.00717.36
8.1.110.0060.00317.45
8.1.100.0050.00317.48
8.1.90.0050.00317.50
8.1.80.0000.00717.48
8.1.70.0050.00217.36
8.1.60.0040.00417.54
8.1.50.0000.00717.53
8.1.40.0000.00817.40
8.1.30.0000.00817.59
8.1.20.0060.00317.53
8.1.10.0040.00417.59
8.1.00.0000.00817.50
8.0.300.0000.00919.85
8.0.290.0000.00716.63
8.0.280.0040.00418.37
8.0.270.0030.00317.26
8.0.260.0000.00718.37
8.0.250.0030.00316.86
8.0.240.0070.00016.93
8.0.230.0040.00416.86
8.0.220.0000.00716.92
8.0.210.0040.00416.91
8.0.200.0030.00316.84
8.0.190.0060.00316.94
8.0.180.0050.00316.92
8.0.170.0000.00816.82
8.0.160.0040.00416.88
8.0.150.0000.00716.81
8.0.140.0040.00416.86
8.0.130.0070.00013.35
8.0.120.0040.00416.86
8.0.110.0000.00716.80
8.0.100.0000.00716.74
8.0.90.0070.00016.88
8.0.80.0070.00716.87
8.0.70.0000.00716.78
8.0.60.0000.00716.68
8.0.50.0030.00317.00
8.0.30.0140.00517.13
8.0.20.0080.01217.02
8.0.10.0000.00817.13
8.0.00.0090.00916.69
7.4.330.0040.00416.49
7.4.320.0030.00316.55
7.4.300.0000.00616.46
7.4.290.0030.00316.35
7.4.280.0060.00316.62
7.4.270.0040.00416.51
7.4.260.0070.00016.52
7.4.250.0070.00016.46
7.4.240.0030.00316.64
7.4.230.0030.00516.40
7.4.220.0020.00516.63
7.4.210.0050.01216.53
7.4.200.0040.00416.50
7.4.160.0080.00916.45
7.4.130.0100.01216.38
7.4.120.0040.01516.56
7.4.110.0070.01016.64
7.4.100.0030.02016.66
7.4.90.0070.01116.59
7.4.80.0060.01619.39
7.4.70.0000.01816.65
7.4.60.0110.00716.43
7.4.50.0070.00716.52
7.4.40.0030.01616.62
7.4.00.0070.00314.95
7.3.330.0020.00213.20
7.3.320.0030.00313.29
7.3.310.0030.00316.40
7.3.300.0030.00316.36
7.3.290.0020.00516.35
7.3.280.0130.00616.29
7.3.260.0110.00716.50
7.3.240.0100.00816.45
7.3.230.0080.01116.43
7.3.210.0030.01616.54
7.3.200.0060.00916.35
7.3.190.0070.01116.56
7.3.180.0110.00616.27
7.3.170.0080.00816.63
7.3.160.0060.00916.50
7.3.40.0030.00914.85
7.3.30.0070.00414.53
7.3.20.0050.00516.83
7.3.10.0070.00316.47
7.3.00.0100.01016.65
7.2.330.0070.01016.82
7.2.320.0150.00916.78
7.2.310.0110.00716.85
7.2.300.0100.00616.47
7.2.290.0140.00816.81
7.2.170.0070.00715.02
7.2.160.0060.01515.12
7.2.150.0070.01117.11
7.2.140.0110.00316.96
7.2.130.0160.00616.89
7.2.120.0070.00416.71
7.2.110.0060.00616.67
7.2.100.0040.00716.87
7.2.90.0080.00316.76
7.2.80.0110.00016.89
7.2.70.0110.00016.91
7.2.60.0150.00616.77
7.2.50.0150.00616.91
7.2.40.0090.01217.18
7.2.30.0070.01116.80
7.2.20.0060.00616.87
7.2.10.0110.00016.82
7.2.00.0030.00716.94
7.1.280.0000.01215.56
7.1.270.0050.00515.79
7.1.260.0030.01215.78
7.1.250.0100.00315.82

preferences:
175.58 ms | 403 KiB | 5 Q