3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(E_ALL); trait NumberSettingConstructor { public function __construct() { $this->number = 1234; } public function __set($name, $value) { printf("UNEXPECTED SETTING OF %s\n", $name); } } class ClassWithTypedProperty { public int $number; use NumberSettingConstructor; } class ClassWithInitializedTypedProperty { public int $number = 0; use NumberSettingConstructor; } class ClassWithTraditionalProperty { public $number; use NumberSettingConstructor; } printf("\n--- Typed Property ---\n"); print_r(new ClassWithTypedProperty()); printf("\n--- Typed Property (with Initialization) ---\n"); print_r(new ClassWithInitializedTypedProperty()); printf("\n--- Traditional Untyped Property ---\n"); print_r(new ClassWithTraditionalProperty());

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.130.0120.00918.72
8.4.120.0070.00224.14
8.4.110.0060.00720.62
8.4.100.0100.00718.80
8.4.90.0110.01120.59
8.4.80.0050.00518.96
8.4.70.0100.00720.74
8.4.60.0150.00518.75
8.4.50.0100.01020.34
8.4.40.0100.01019.34
8.4.30.0130.00718.26
8.4.20.0040.00718.91
8.4.10.0100.00717.89
8.3.260.0130.00616.73
8.3.250.0110.00717.40
8.3.240.0140.00417.18
8.3.230.0060.00316.72
8.3.220.0100.01018.88
8.3.210.0030.00418.50
8.3.200.0060.00416.70
8.3.190.0140.00717.16
8.3.180.0120.00619.00
8.3.170.0070.01116.66
8.3.160.0060.01519.02
8.3.150.0040.01417.18
8.3.140.0030.00519.07
8.3.130.0060.00318.25
8.3.120.0070.00418.89
8.3.110.0090.00020.94
8.3.100.0120.00816.75
8.3.90.0050.00318.18
8.3.80.0070.00318.18
8.3.70.0070.00718.56
8.3.60.0070.01116.50
8.3.50.0110.00218.11
8.3.40.0070.01418.87
8.3.30.0140.00018.66
8.3.20.0000.00822.29
8.3.10.0030.00523.66
8.3.00.0090.00022.43
8.2.290.0090.00620.39
8.2.280.0100.01218.63
8.2.270.0070.01016.96
8.2.260.0070.01016.88
8.2.250.0080.00018.28
8.2.240.0080.00017.44
8.2.230.0000.01222.58
8.2.220.0030.00624.06
8.2.210.0060.00926.77
8.2.200.0030.00716.75
8.2.190.0120.00316.63
8.2.180.0070.01118.29
8.2.170.0090.00618.95
8.2.160.0100.00722.96
8.2.150.0090.00024.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0050.00326.16
8.2.110.0000.01021.06
8.2.100.0030.01017.90
8.2.90.0040.00417.97
8.2.80.0040.00418.16
8.2.70.0040.00417.93
8.2.60.0040.00418.09
8.2.50.0000.00818.10
8.2.40.0050.00321.21
8.2.30.0040.00419.17
8.2.20.0000.00718.02
8.2.10.0050.00219.14
8.2.00.0040.00419.26
8.1.330.0160.00522.02
8.1.320.0130.00716.39
8.1.310.0100.00618.05
8.1.300.0040.00418.31
8.1.290.0060.00318.88
8.1.280.0190.00325.92
8.1.270.0030.00621.96
8.1.260.0050.00526.35
8.1.250.0050.00328.09
8.1.240.0070.01423.92
8.1.230.0060.00622.77
8.1.220.0090.00017.74
8.1.210.0030.00618.77
8.1.200.0040.00817.36
8.1.190.0030.00717.13
8.1.180.0040.00418.10
8.1.170.0040.00418.57
8.1.160.0040.00418.96
8.1.150.0030.00618.89
8.1.140.0000.00720.87
8.1.130.0030.00320.17
8.1.120.0040.00417.52
8.1.110.0050.00317.53
8.1.100.0000.00717.50
8.1.90.0050.00317.48
8.1.80.0040.00417.49
8.1.70.0040.00417.48
8.1.60.0030.00517.63
8.1.50.0040.00717.55
8.1.40.0040.00417.43
8.1.30.0020.00517.67
8.1.20.0050.00317.55
8.1.10.0050.00317.40
8.1.00.0030.00617.53
8.0.300.0030.00519.60
8.0.290.0080.00016.63
8.0.280.0040.00418.45
8.0.270.0030.00317.32
8.0.260.0000.00621.98
8.0.250.0000.00716.87
8.0.240.0000.00816.87
8.0.230.0030.00316.94
8.0.220.0050.00316.85
8.0.210.0000.00716.86
8.0.200.0060.00317.02
8.0.190.0030.00316.96
8.0.180.0040.00416.91
8.0.170.0060.00317.01
8.0.160.0000.00817.00
8.0.150.0090.00316.88
8.0.140.0080.00016.86
8.0.130.0040.00413.30
8.0.120.0030.00516.80
8.0.110.0000.00716.82
8.0.100.0040.00416.76
8.0.90.0000.00716.78
8.0.80.0120.00316.92
8.0.70.0050.00316.85
8.0.60.0040.00417.02
8.0.50.0000.00816.77
8.0.30.0110.00617.12
8.0.20.0070.01116.94
8.0.10.0040.00417.03
8.0.00.0130.00616.73
7.4.330.0050.00016.89
7.4.320.0000.00616.65
7.4.300.0000.00816.63
7.4.290.0030.00316.50
7.4.280.0050.00216.61
7.4.270.0000.00716.63
7.4.260.0060.00013.30
7.4.250.0030.00316.42
7.4.240.0060.00216.54
7.4.230.0030.00316.60
7.4.220.0050.00216.52
7.4.210.0040.01316.62
7.4.200.0000.00816.72
7.4.140.0150.00317.86
7.4.130.0120.00616.52
7.4.120.0060.01216.61
7.4.110.0100.00716.65
7.4.100.0060.01016.61
7.4.90.0100.00716.56
7.4.80.0100.01319.39
7.4.70.0260.01416.62
7.4.60.0070.01116.66
7.4.50.0090.00616.33
7.4.40.0100.00716.64
7.3.330.0000.00616.13
7.3.320.0000.00512.97
7.3.310.0070.00016.16
7.3.300.0000.00816.18
7.3.290.0030.00316.13
7.3.280.0030.01016.11
7.3.260.0100.00716.28
7.3.240.0130.00516.22
7.3.230.0070.01016.31
7.3.210.0090.00916.28
7.3.200.0120.01016.44
7.3.190.0080.00816.41
7.3.180.0170.00016.37
7.3.170.0060.01316.20
7.3.160.0070.01416.27
7.3.90.0000.01314.69
7.3.80.0110.00314.71
7.3.70.0070.01314.56
7.3.60.0020.01314.69
7.3.50.0050.00814.55
7.3.40.0030.01014.58
7.3.30.0110.00814.61
7.3.20.0070.00716.62
7.3.10.0110.00416.37
7.3.00.0090.00616.24
7.2.330.0070.01016.25
7.2.320.0140.01016.30
7.2.310.0060.01016.50
7.2.300.0060.01116.07
7.2.290.0130.00316.51
7.2.220.0060.00814.69
7.2.210.0120.00314.71
7.2.200.0030.01914.64
7.2.190.0100.01014.69
7.2.180.0140.00314.74
7.2.170.0110.00414.82
7.2.160.0090.00614.88
7.2.150.0040.01116.47
7.2.140.0090.00616.80
7.2.130.0130.00316.57
7.2.120.0040.01116.57
7.2.110.0090.00716.61
7.2.100.0080.00916.65
7.2.90.0120.00616.73
7.2.80.0090.01216.82
7.2.70.0080.00816.75
7.2.60.0090.00616.61
7.2.50.0030.01216.38
7.2.40.0110.00316.57
7.2.30.0270.01716.78
7.2.20.0190.02216.71
7.2.10.0250.00316.50
7.2.00.0160.01316.67
7.1.320.0060.01215.41
7.1.310.0070.00715.82
7.1.300.0120.00615.50
7.1.290.0110.00415.63
7.1.280.0030.01015.40
7.1.270.0030.01015.37
7.1.260.0090.00615.49
7.1.250.0060.00915.38

preferences:
149.35 ms | 403 KiB | 5 Q