3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PropTypeTest { public int $int; public string $string; public array $arr; public callable $callable; public stdClass $std; public OtherThing $other; public $mixed; } $reflector = new ReflectionClass(PropTypeTest::class); foreach ($reflector->getProperties() as $name => $property) { if ($property->hasType()) { printf("public %s $%s;\n", $property->getType(), $property->getName()); } else printf("public $%s;\n", $property->getName()); }

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)
7.0.40.0270.05020.09
7.0.30.0500.06320.07
7.0.20.0530.05020.11
7.0.10.0430.05320.38
7.0.00.0370.09320.08
5.6.190.0030.06720.46
5.6.180.0530.05020.47
5.6.170.0400.05020.44
5.6.160.0370.06020.53
5.6.150.0470.04320.35
5.6.140.0330.07020.39
5.6.130.0330.06320.36
5.6.120.0070.06020.33
5.6.110.0000.06720.40
5.6.100.0070.06320.36
5.6.90.0370.05720.38
5.6.80.0300.06019.76
5.6.70.0070.06019.57
5.6.60.0300.06019.77
5.6.50.0370.04719.71
5.6.40.0270.05719.79
5.6.30.0370.05319.69
5.6.20.0300.06019.72
5.6.10.0300.06019.74
5.6.00.0200.06319.79
5.5.330.0130.05320.25
5.5.320.0570.07720.28
5.5.310.0500.05720.32
5.5.300.0400.06020.24
5.5.290.0370.05320.24
5.5.280.0170.05020.10
5.5.270.0100.05720.21
5.5.260.0330.06020.20
5.5.250.0430.07019.91
5.5.240.0400.05719.46
5.5.230.0200.04319.51
5.5.220.0130.05319.38
5.5.210.0370.04719.53
5.5.200.0230.06319.56
5.5.190.0270.06719.55
5.5.180.0330.05319.33
5.5.160.0470.04319.46
5.5.150.0400.04719.51
5.5.140.0330.05319.73
5.5.130.0370.06319.56
5.5.120.0370.05019.51
5.5.110.0430.05319.36
5.5.100.0470.06319.46
5.5.90.0500.05319.41
5.5.80.0470.05019.38
5.5.70.0430.05719.58
5.5.60.0500.04719.45
5.5.50.0330.05719.37
5.5.40.0500.03319.48
5.5.30.0370.05319.62
5.5.20.0370.05319.48
5.5.10.0400.05019.45
5.5.00.0430.04719.34

preferences:
147.32 ms | 1394 KiB | 7 Q