3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Role { public $public; protected $protected; private $private; public function __construct($prop) { $this->public = $prop; $this->protected = $prop; $this->private = $prop; } } $test = [(new Role(false)), (new Role(1)), (new Role(null)), (new Role("1")), (new Role(2)), (new Role(0))]; var_export( array_unique($test, SORT_REGULAR) ); echo "\n---\n"; var_export( array_filter( $test, fn($o, $k) => array_search($o, $test, true) === $k, ARRAY_FILTER_USE_BOTH ) );

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.0100.01120.51
8.4.110.0120.00918.98
8.4.100.0140.00518.69
8.4.90.0130.00720.52
8.4.80.0080.00418.69
8.4.70.0120.00819.00
8.4.60.0110.00618.85
8.4.50.0130.00718.60
8.4.40.0130.00717.71
8.4.30.0040.01124.03
8.4.20.0050.00519.65
8.4.10.0180.00019.43
8.3.250.0130.00518.85
8.3.240.0100.00916.61
8.3.230.0150.00716.70
8.3.220.0110.00718.85
8.3.210.0100.00916.85
8.3.200.0060.00516.80
8.3.190.0110.00617.08
8.3.180.0030.00518.32
8.3.170.0140.00417.08
8.3.160.0130.00719.05
8.3.150.0150.00318.77
8.3.140.0000.00917.29
8.3.130.0000.00916.62
8.3.120.0330.00916.16
8.3.110.0320.01016.40
8.3.100.0320.01316.76
8.3.90.0280.01416.42
8.3.80.0370.01016.42
8.3.70.0280.01316.29
8.3.60.0300.01016.38
8.3.50.0410.00616.34
8.3.40.0320.00617.28
8.3.30.0330.00417.40
8.3.20.0300.01717.63
8.3.10.0300.01117.14
8.3.00.0200.00317.61
8.2.290.0150.00418.77
8.2.280.0080.01222.58
8.2.270.0030.00616.88
8.2.260.0110.00817.22
8.2.250.0030.00618.22
8.2.240.0270.01516.69
8.2.230.0250.01616.46
8.2.220.0230.00916.71
8.2.210.0240.01016.27
8.2.200.0360.00316.44
8.2.190.0300.01016.51
8.2.180.0410.00016.39
8.2.170.0370.00717.71
8.2.160.0270.01717.62
8.2.150.0330.00917.70
8.2.140.0420.00017.56
8.2.130.0340.00917.44
8.2.120.0370.00617.19
8.2.110.0530.00917.38
8.2.100.0370.00617.35
8.2.90.0340.01117.66
8.2.80.0290.00717.45
8.2.70.0280.01117.44
8.2.60.0310.00817.12
8.2.50.0320.00617.59
8.2.40.0320.00617.46
8.2.30.0330.00317.54
8.2.20.0370.00017.39
8.2.10.0300.01017.46
8.2.00.0340.00617.49
8.1.330.0130.00616.06
8.1.320.0090.01116.30
8.1.310.0140.00418.63
8.1.300.0350.00915.91
8.1.290.0340.01215.87
8.1.280.0280.01115.99
8.1.270.0420.00017.04
8.1.260.0350.00617.13
8.1.250.0290.01117.25
8.1.240.0290.00717.25
8.1.230.0410.00316.92
8.1.220.0320.00017.30
8.1.210.0250.00617.04
8.1.200.0270.01017.31
8.1.190.0270.01017.23
8.1.180.0290.00717.06
8.1.170.0260.01116.93
8.1.160.0220.01516.87
8.1.150.0530.00417.02
8.1.140.0280.00916.90
8.1.130.0270.01016.97
8.1.120.0220.01616.97
8.1.110.0210.01717.34
8.1.100.0290.00717.27
8.1.90.0290.00917.37
8.1.80.0290.00717.14
8.1.70.0260.01117.23
8.1.60.0200.02017.25
8.1.50.0360.00417.28
8.1.40.0280.00517.45
8.1.30.0150.00417.27
8.1.20.0150.00717.15
8.1.10.0220.00017.32
8.1.00.0280.00317.01

preferences:
27.29 ms | 403 KiB | 5 Q