3v4l.org

run code in 300+ PHP versions simultaneously
<?php function batchDelete(): \Generator { // $entityManager = $this->getEntityManager($class); $queryResults = range(0, 102); $i = 0; $removedObjects = []; foreach ($queryResults as $pos => $object) { // $entityManager->remove($object[0]); $removedObjects[] = $object; if (0 === (++$i % 20)) { yield from $removedObjects; $removedObjects = []; // $entityManager->flush(); // $entityManager->clear(); } } yield from $removedObjects; // $entityManager->flush(); // $entityManager->clear(); } function callerFunctionBatchDelete() { foreach (batchDelete() as $deletedObject) { // Fire any event you may need regarding `$deletedObject`. echo 'Some operation with object "'.$deletedObject."\".\n"; } } callerFunctionBatchDelete();

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.3.130.0140.00418.08
8.3.120.0000.00920.93
8.3.110.0090.00020.94
8.3.100.0090.00018.37
8.3.90.0160.00026.77
8.3.80.0090.00319.36
8.3.70.0140.00718.34
8.3.60.0070.01116.49
8.3.50.0060.01223.59
8.3.40.0100.01022.08
8.3.30.0070.00718.66
8.3.20.0000.00824.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.250.0130.00718.41
8.2.240.0030.00617.29
8.2.230.0000.00922.58
8.2.220.0090.00024.06
8.2.210.0060.00326.77
8.2.200.0030.00718.88
8.2.190.0150.00016.58
8.2.180.0070.01125.92
8.2.170.0080.00818.91
8.2.160.0040.01122.96
8.2.150.0120.00325.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00421.04
8.2.110.0060.00320.90
8.2.100.0080.00317.72
8.2.90.0030.00517.84
8.2.80.0050.00519.62
8.2.70.0050.00317.63
8.2.60.0040.00417.50
8.2.50.0080.00017.75
8.2.40.0060.00319.23
8.2.30.0070.00019.20
8.2.20.0040.00418.20
8.2.10.0000.00719.24
8.2.00.0040.00419.23
8.1.300.0040.00418.38
8.1.290.0060.00330.84
8.1.280.0080.00625.92
8.1.270.0050.00323.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00322.02
8.1.230.0040.00822.03
8.1.220.0040.00417.77
8.1.210.0030.01018.77
8.1.200.0050.00317.48
8.1.190.0040.00417.35
8.1.180.0110.00018.10
8.1.170.0060.00319.13
8.1.160.0070.00019.02
8.1.150.0050.00318.82
8.1.140.0070.00318.84
8.1.130.0000.00717.46
8.1.120.0000.00717.43
8.1.110.0000.00817.51
8.1.100.0050.00217.36
8.1.90.0000.00717.45
8.1.80.0040.00417.39
8.1.70.0030.00317.33
8.1.60.0000.01117.47
8.1.50.0030.00617.55
8.1.40.0000.00817.42
8.1.30.0040.00417.66
8.1.20.0000.00817.71
8.1.10.0040.00417.52
8.1.00.0050.00317.37
8.0.300.0070.00019.98
8.0.290.0040.00416.75
8.0.280.0040.00418.45
8.0.270.0040.00416.86
8.0.260.0000.00816.75
8.0.250.0070.00016.88
8.0.240.0040.00417.05
8.0.230.0040.00316.99
8.0.220.0030.00316.80
8.0.210.0040.00416.89
8.0.200.0000.00816.83
8.0.190.0000.00716.98
8.0.180.0000.00716.87
8.0.170.0030.00616.94
8.0.160.0070.00416.91
8.0.150.0080.00016.89
8.0.140.0000.00716.80
8.0.130.0000.00513.30
8.0.120.0020.00516.98
8.0.110.0000.00716.75
8.0.100.0000.00716.85
8.0.90.0040.00416.77
8.0.80.0080.00716.88
8.0.70.0040.00416.79
8.0.60.0040.00416.73
8.0.50.0000.00716.91
8.0.30.0100.00717.15
8.0.20.0140.00616.92
8.0.10.0060.00317.02
8.0.00.0100.00916.92
7.4.330.0000.00515.55
7.4.320.0030.00316.62
7.4.300.0000.00716.60
7.4.290.0000.00716.58
7.4.280.0000.00716.65
7.4.270.0000.00716.54
7.4.260.0030.00313.40
7.4.250.0000.00816.58
7.4.240.0070.00016.63
7.4.230.0070.00016.69
7.4.220.0020.00516.53
7.4.210.0080.00916.59
7.4.200.0050.00316.52
7.4.130.0140.00716.53
7.4.120.0200.00016.44
7.4.110.0070.01116.33
7.4.100.0170.00916.55
7.4.90.0070.01116.38
7.4.80.0150.01015.92
7.4.70.0110.01515.60
7.4.60.0170.00715.80
7.4.50.0160.00816.09
7.4.40.0180.00616.11
7.4.30.0210.00316.09
7.4.20.0070.01116.68
7.4.10.0140.00516.47
7.4.00.0110.00816.39
7.3.330.0030.00416.22
7.3.320.0000.00613.27
7.3.310.0030.00616.28
7.3.300.0000.00616.34
7.3.290.0100.00816.33
7.3.260.0160.00316.23
7.3.240.0070.01616.39
7.3.230.0160.00316.42
7.3.220.0130.01316.48
7.3.210.0120.01215.96
7.3.200.0130.00916.23
7.3.190.0150.00816.34
7.3.180.0200.00515.88
7.3.170.0120.01215.86
7.3.160.0140.00915.83
7.3.150.0150.00816.09
7.3.140.0120.00816.45
7.3.130.0080.01016.50
7.3.120.0060.01216.38
7.3.110.0100.01016.34
7.3.100.0000.01916.53
7.3.90.0050.01416.55
7.3.80.0150.00516.64
7.3.70.0110.00816.49
7.3.60.0100.00716.45
7.3.50.0100.01016.41
7.3.40.0130.01016.51
7.3.30.0080.00816.46
7.3.20.0040.01816.49
7.3.10.0090.01516.06
7.3.00.0240.00316.25
7.2.340.0100.00916.79
7.2.330.0140.01116.50
7.2.320.0110.01216.34
7.2.310.0180.00616.27
7.2.300.0140.01016.14
7.2.290.0180.01016.54
7.2.280.0080.01116.67
7.2.270.0080.01116.88
7.2.260.0060.01416.75
7.2.250.0120.00616.60
7.2.240.0080.01116.92
7.2.230.0060.01216.42
7.2.220.0110.01116.73
7.2.210.0100.01616.79
7.2.200.0080.01116.68
7.2.190.0000.01916.63
7.2.180.0120.00916.45
7.2.170.0160.00716.63
7.2.160.0180.00416.66
7.2.150.0140.01216.28
7.2.140.0080.01916.04
7.2.130.0150.01516.27
7.2.120.0130.00816.62
7.2.110.0130.01116.73
7.2.100.0130.01116.56
7.2.90.0140.01416.68
7.2.80.0190.00316.79
7.2.70.0150.00316.88
7.2.60.0160.00416.89
7.2.50.0410.00316.79
7.2.40.0080.01416.79
7.2.30.0110.01216.70
7.2.20.0100.01016.73
7.2.10.0120.00916.68
7.2.00.0060.01416.63

preferences:
26.3 ms | 403 KiB | 5 Q