3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait A1 { public $propA1; } trait A2 { use A1; public $propA2; } trait A3 { use A2; public $propA3; } trait B1 { public $propB1; } trait B2 { use B1; public $propB2; } trait B3 { use B2; public $propB3; } class X { use A3; } class Y extends X { use B3; } function getTraits(ReflectionClass $c): array { $t = array_values(array_map(getTraits(...), $c->getTraits())); return array_merge($c->getTraitNames(), ...$t); } $rc = new ReflectionClass('Y'); $traits = []; $c = $rc; while ($c) { $traits[] = getTraits($c); $c = $c->getParentClass(); } var_dump(array_merge(...$traits));

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.5.30.0310.00816.35
8.5.20.0270.00716.55
8.5.10.0320.01016.68
8.5.00.0300.00616.48
8.4.180.0310.00720.56
8.4.170.0230.00819.77
8.4.160.0260.01219.57
8.4.150.0330.00819.47
8.4.140.0290.00917.48
8.4.130.0180.00517.55
8.4.120.0240.00917.70
8.4.110.0290.00817.79
8.4.100.0270.00817.71
8.4.90.0290.00717.72
8.4.80.0290.00817.76
8.4.70.0300.00617.72
8.4.60.0270.00817.84
8.4.50.0290.00617.72
8.4.40.0260.00717.77
8.4.30.0300.00717.51
8.4.20.0310.00617.82
8.4.10.0330.00617.49
8.3.300.0240.00718.19
8.3.290.0230.00518.22
8.3.280.0260.00518.20
8.3.270.0250.00916.69
8.3.260.0260.00816.54
8.3.250.0280.00616.61
8.3.240.0300.00616.59
8.3.230.0290.00716.67
8.3.220.0290.00616.58
8.3.210.0270.00716.67
8.3.200.0230.00716.71
8.3.190.0250.00716.67
8.3.180.0280.00616.67
8.3.170.0270.00516.51
8.3.160.0270.00716.75
8.3.150.0250.01016.72
8.3.140.0280.00816.74
8.3.130.0210.00816.54
8.3.120.0290.00516.75
8.3.110.0190.00616.73
8.3.100.0220.00216.64
8.3.90.0170.00616.62
8.3.80.0200.00716.58
8.3.70.0260.00816.62
8.3.60.0280.00716.58
8.3.50.0290.00516.60
8.3.40.0280.00517.77
8.3.30.0170.00617.86
8.3.20.0180.00717.93
8.3.10.0150.00417.88
8.3.00.0130.00517.84

preferences:
45 ms | 719 KiB | 5 Q