3v4l.org

run code in 300+ PHP versions simultaneously
<?php function objectType($name, ...$fields) { if (empty($fields)) { throw new \RuntimeException(); } if (!is_string(key($fields[0]))) { $interfaces = array_shift($fields); } else { $interfaces = []; } if (empty($fields)) { throw new \RuntimeException(); } $def = [ 'name' => $name, 'interfaces' => $interfaces, 'fields' => [], ]; foreach ($fields as &$field) { $def['fields'][$field['name']] = $field; } return $def; } function field($name, $type, ...$args) { $def = [ 'name' => $name, 'type' => $type, 'args' => [], 'resolve' => null, ]; if (!empty($args) && is_callable(end($args))) { $def['resolve'] = array_pop($args); } foreach ($args as &$arg) { $def['args'][$arg['name']] = $arg; } return $def; } function argument($name, $type, $value = null) { $def = [ 'name' => $name, 'type' => $type, 'defaultValue' => $value, ]; return $def; } $IntType = ['name' => 'Int']; $StringType = ['name' => 'String']; $BlogType = objectType('Blog', field('id', $IntType), field('name', $StringType)); $UserType = objectType('Blog', field('id', $IntType), field('email', $StringType)); $QueryType = objectType('Query', field('blog', $BlogType, argument('id', $IntType)), field('user', $UserType, argument('id', $IntType))); var_dump($QueryType);

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.0190.00416.88
8.3.50.0120.00722.09
8.3.40.0110.00418.62
8.3.30.0160.00618.67
8.3.20.0090.00020.33
8.3.10.0180.00023.48
8.3.00.0100.00319.38
8.2.180.0230.00016.75
8.2.170.0090.00622.96
8.2.160.0070.00720.57
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0090.00017.50
8.2.120.0070.00726.35
8.2.110.0000.00919.05
8.2.100.0080.00418.03
8.2.90.0000.00819.26
8.2.80.0040.00417.97
8.2.70.0060.00317.62
8.2.60.0080.00017.93
8.2.50.0090.00018.07
8.2.40.0080.00019.34
8.2.30.0040.00420.79
8.2.20.0000.00817.89
8.2.10.0080.00018.30
8.2.00.0000.00718.17
8.1.280.0060.01325.92
8.1.270.0040.00423.61
8.1.260.0030.00528.09
8.1.250.0150.00428.09
8.1.240.0070.00720.86
8.1.230.0070.00417.51
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0030.00617.23
8.1.190.0060.00317.13
8.1.180.0030.00518.10
8.1.170.0000.00918.46
8.1.160.0040.00421.97
8.1.150.0080.00018.90
8.1.140.0080.00319.61
8.1.130.0030.00317.75
8.1.120.0040.00417.43
8.1.110.0030.00517.37
8.1.100.0000.00817.56
8.1.90.0040.00417.41
8.1.80.0050.00317.46
8.1.70.0040.00417.49
8.1.60.0030.00617.52
8.1.50.0030.00717.61
8.1.40.0080.00017.62
8.1.30.0000.00917.69
8.1.20.0080.00017.59
8.1.10.0030.00617.64
8.1.00.0040.00417.57
8.0.300.0040.00418.77
8.0.290.0080.00016.88
8.0.280.0040.00418.45
8.0.270.0000.00717.21
8.0.260.0000.00717.31
8.0.250.0040.00417.01
8.0.240.0030.00317.07
8.0.230.0000.00716.88
8.0.220.0060.00316.93
8.0.210.0080.00316.86
8.0.200.0040.00416.94
8.0.190.0040.00416.91
8.0.180.0000.00816.98
8.0.170.0000.00816.97
8.0.160.0000.00916.85
8.0.150.0040.00416.85
8.0.140.0040.00416.91
8.0.130.0030.00313.29
8.0.120.0030.00516.92
8.0.110.0000.00816.98
8.0.100.0050.00216.79
8.0.90.0000.00716.84
8.0.80.0030.01216.99
8.0.70.0080.00016.94
8.0.60.0070.00016.76
8.0.50.0050.00316.94
8.0.30.0110.01017.01
8.0.20.0110.01117.40
8.0.10.0030.00517.03
8.0.00.0120.00816.82
7.4.330.0000.00616.77
7.4.320.0000.00616.51
7.4.300.0000.00716.68
7.4.290.0040.00416.48
7.4.280.0050.00316.64
7.4.270.0040.00416.57
7.4.260.0000.00716.46
7.4.250.0040.00416.43
7.4.240.0040.00416.63
7.4.230.0040.00316.71
7.4.220.0130.00616.59
7.4.210.0090.00616.66
7.4.200.0070.00016.44
7.4.160.0180.00016.39
7.4.150.0140.00717.40
7.4.140.0120.00917.86
7.4.130.0150.00516.52
7.4.120.0110.01016.55
7.4.110.0170.00516.48
7.4.100.0150.00916.43
7.4.90.0060.01416.71
7.4.80.0070.01019.39
7.4.70.0100.01416.61
7.4.60.0180.00016.62
7.4.50.0030.00716.40
7.4.40.0070.01316.35
7.4.30.0090.00916.39
7.4.00.0060.01015.20
7.3.330.0030.00413.37
7.3.320.0030.00313.39
7.3.310.0030.00316.38
7.3.300.0040.00216.41
7.3.290.0090.00716.40
7.3.280.0060.01016.38
7.3.270.0100.01017.40
7.3.260.0140.00616.45
7.3.250.0120.01116.45
7.3.240.0120.01116.55
7.3.230.0100.01016.44
7.3.210.0100.01016.70
7.3.200.0110.00816.44
7.3.190.0090.00916.68
7.3.180.0100.00716.54
7.3.170.0140.00816.50
7.3.160.0100.01316.34
7.2.330.0120.01216.80
7.2.320.0130.01316.76
7.2.310.0060.01216.86
7.2.300.0120.00616.43
7.2.290.0120.00616.76
7.2.60.0100.00316.85
7.2.00.0030.00919.58
7.1.200.0050.00215.73
7.1.100.0040.00718.35
7.1.70.0000.00717.20
7.1.60.0210.00319.36
7.1.50.0090.00917.01
7.1.00.0030.07722.36
7.0.200.0060.00316.68
7.0.60.0070.08320.05
7.0.50.0030.08017.87
7.0.40.0070.04720.13
7.0.30.0200.04720.11
7.0.20.0270.07720.34
7.0.10.0130.08020.23
7.0.00.0000.08320.23
5.6.280.0000.03321.08
5.6.210.0130.06320.48
5.6.200.0170.07018.23
5.6.190.0000.06320.48
5.6.180.0230.04020.52
5.6.170.0270.04020.44
5.6.160.0070.08320.48
5.6.150.0130.06318.15
5.6.140.0070.05018.25
5.6.130.0030.05018.13
5.6.120.0100.04021.13
5.6.110.0100.08321.14
5.6.100.0070.09020.97
5.6.90.0030.04320.98
5.6.80.0100.07320.43
5.5.350.0200.08020.34
5.5.340.0070.07317.94
5.5.330.0030.09020.47
5.5.320.0030.04020.36
5.5.310.0300.05020.28
5.5.300.0030.06717.95
5.5.290.0100.06718.03
5.5.280.0030.06020.88
5.5.270.0070.04020.75
5.5.260.0070.04720.79
5.5.250.0130.07320.58
5.5.240.0270.04720.07

preferences:
47.7 ms | 401 KiB | 5 Q