3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function method1(): string { return 'hello'; } } class B { function method2(): string { return 'world'; } } final class SomeKindOfException extends OutOfBoundsException { public static function forMismatchingRequirements(mixed $value, string $type): self { return new self(sprintf('Expected value of type "%s", got "%s"', $type, get_debug_type($value))); } } /** * @template T of object * @param class-string<T> $type * @throws SomeKindOfException * @return T */ function typed(mixed $value, string $type): mixed { if (! $value instanceof $type) { throw SomeKindOfException::forMismatchingRequirements($value, $type); } return $value; } function expression1(): mixed { return new A(); } function expression2(): mixed { return new B(); } function expression3(): mixed { return new stdClass(); } var_dump(typed(expression1(), A::class)->method1()); var_dump(typed(expression2(), B::class)->method2()); var_dump(typed(expression3(), B::class)->method2());

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.0090.01024.10
8.4.110.0090.01122.56
8.4.100.0080.01018.88
8.4.90.0130.00818.84
8.4.80.0110.00818.88
8.4.70.0060.00320.66
8.4.60.0130.00718.96
8.4.50.0140.00718.56
8.4.40.0140.00717.95
8.4.30.0030.00619.02
8.4.20.0130.00619.70
8.4.10.0100.01019.86
8.3.250.0040.00419.04
8.3.240.0120.00717.29
8.3.230.0110.00816.71
8.3.220.0130.00418.82
8.3.210.0110.00718.35
8.3.200.0060.00316.79
8.3.190.0100.00817.13
8.3.180.0100.00817.25
8.3.170.0060.01220.78
8.3.160.0040.01417.18
8.3.150.0070.01017.28
8.3.140.0120.00616.86
8.3.130.0040.01118.59
8.3.120.0150.00020.40
8.3.110.0040.00416.82
8.3.100.0050.00516.49
8.3.90.0040.01126.77
8.3.80.0090.00018.68
8.3.70.0140.00316.75
8.3.60.0070.00718.43
8.3.50.0040.01118.66
8.3.40.0140.00721.60
8.3.30.0140.00620.94
8.3.20.0090.01022.45
8.3.10.0120.00722.45
8.3.00.0100.00919.50
8.2.290.0150.00520.52
8.2.280.0100.00918.75
8.2.270.0070.01117.05
8.2.260.0060.00316.36
8.2.250.0080.00018.25
8.2.240.0080.00017.07
8.2.230.0060.00322.58
8.2.220.0090.00024.06
8.2.210.0080.00626.77
8.2.200.0000.00916.88
8.2.190.0110.00716.58
8.2.180.0070.01018.27
8.2.170.0110.01019.52
8.2.160.0140.00620.73
8.2.150.0150.00619.73
8.2.140.0070.01021.08
8.2.130.0090.00621.00
8.2.120.0090.00819.81
8.2.110.0110.00519.92
8.2.100.0130.00619.91
8.2.90.0090.00719.47
8.2.80.0060.00919.83
8.2.70.0150.00119.38
8.2.60.0110.00619.59
8.2.50.0110.00519.77
8.2.40.0090.00619.50
8.2.30.0120.00619.32
8.2.20.0090.00819.39
8.2.10.0110.00619.25
8.2.00.0130.00519.33
8.1.330.0110.00721.98
8.1.320.0130.00716.10
8.1.310.0090.00916.50
8.1.300.0060.00316.29
8.1.290.0040.00430.84
8.1.280.0000.01825.92
8.1.270.0120.00422.63
8.1.260.0100.00722.58
8.1.250.0080.00922.09
8.1.240.0090.00919.09
8.1.230.0110.00919.09
8.1.220.0120.00619.43
8.1.210.0100.00718.93
8.1.200.0130.00519.30
8.1.190.0090.00919.12
8.1.180.0100.00818.94
8.1.170.0090.00719.27
8.1.160.0130.00419.05
8.1.150.0090.00819.29
8.1.140.0080.01019.19
8.1.130.0070.01019.07
8.1.120.0120.00519.05
8.1.110.0110.00619.69
8.1.100.0130.00520.37
8.1.90.0130.00419.11
8.1.80.0050.01220.35
8.1.70.0110.00619.34
8.1.60.0080.00919.15
8.1.50.0110.00719.13
8.1.40.0090.00919.11
8.1.30.0090.00819.51
8.1.20.0090.00820.60
8.1.10.0090.00819.22
8.1.00.0090.00819.11

preferences:
31.99 ms | 403 KiB | 5 Q