3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class DataMapper { // 削除 public function delete(array $conditions): int { // 削除に失敗して例外が発生したと仮定 throw new RangeException('削除に失敗しました'); // 本来は削除に成功した行数を rowCount で得て返す return 1; } } class CommentMapper extends DataMapper { // コメント削除 public function destroyComment(int $comment_id): int { try { $conditions = ['id'=>$comment_id]; $rowCount = parent::delete($conditions); return $rowCount; } catch (Exception $e) { echo $e->getMessage(); } } } class CommentController { public function destroyAction(int $comment_id): void { $commentMapper = new CommentMapper(); $rowCount = $commentMapper->destroyComment($comment_id); var_dump($rowCount); } } $commentController = new CommentController(); $commentController->destroyAction(1);

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.10.0100.00719.68
8.5.00.0120.01020.18
8.4.150.0030.00014.05
8.4.140.0140.00717.77
8.4.130.0090.01118.02
8.4.120.0100.01122.41
8.4.110.0100.01022.48
8.4.100.0130.00918.76
8.4.90.0140.00518.86
8.4.80.0090.01118.00
8.4.70.0090.00617.93
8.4.60.0120.01018.83
8.4.50.0050.00418.09
8.4.40.0080.00417.96
8.4.30.0040.00422.25
8.4.20.0070.01419.59
8.4.10.0100.01022.04
8.3.280.0150.00618.54
8.3.270.0090.01016.54
8.3.260.0110.00916.84
8.3.250.0080.01119.10
8.3.240.0080.01117.18
8.3.230.0080.00916.48
8.3.220.0090.00819.00
8.3.210.0080.00718.49
8.3.200.0110.01016.73
8.3.190.0100.00916.95
8.3.180.0100.00916.75
8.3.170.0090.00918.86
8.3.160.0060.01216.82
8.3.150.0070.00717.34
8.3.140.0030.00620.77
8.3.130.0070.01418.44
8.3.120.0060.00920.93
8.3.110.0060.00320.94
8.3.100.0030.00618.84
8.3.90.0000.00826.77
8.3.80.0040.00417.97
8.3.70.0080.00816.88
8.3.60.0030.01520.48
8.3.50.0070.00716.68
8.3.40.0110.00820.33
8.3.30.0070.00720.34
8.3.20.0000.01424.18
8.3.10.0000.00824.66
8.3.00.0070.00026.16
8.2.290.0120.00720.60
8.2.280.0050.00418.45
8.2.270.0000.01916.70
8.2.260.0140.00716.59
8.2.250.0040.00417.02
8.2.240.0030.00517.33
8.2.230.0000.00722.58
8.2.220.0040.00424.06
8.2.210.0040.00426.77
8.2.200.0060.00316.63
8.2.190.0180.00418.43
8.2.180.0040.01125.92
8.2.170.0100.01018.91
8.2.160.0100.00622.96
8.2.150.0050.00325.66
8.2.140.0000.00724.66
8.2.130.0050.00326.16
8.2.120.0040.00419.48
8.2.110.0110.00022.08
8.2.100.0070.00718.03
8.2.90.0030.00617.97
8.2.80.0080.00019.33
8.2.70.0090.00979.33
8.2.60.0160.00379.33
8.2.50.0180.00079.33
8.2.40.0080.00879.33
8.2.30.0130.00579.33
8.2.20.0000.01679.33
8.2.10.0190.00079.33
8.2.00.0080.00879.33
8.1.330.0080.01021.82
8.1.320.0090.00616.39
8.1.310.0000.01018.36
8.1.300.0090.00018.08
8.1.290.0090.00030.84
8.1.280.0030.01325.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0100.00728.09
8.1.240.0070.00323.92
8.1.230.0080.00422.75
8.1.220.0030.00517.78
8.1.210.0070.00318.80
8.1.200.0120.00479.33
8.1.190.0130.00479.33
8.1.180.0100.00779.33
8.1.170.0180.00079.33
8.1.160.0110.00779.33
8.1.150.0080.00879.33
8.1.140.0130.00379.33
8.1.130.0160.00379.33
8.1.120.0180.00079.33
8.1.110.0050.01179.33
8.1.100.0000.01679.33
8.1.90.0160.00079.33
8.1.80.0060.01379.33
8.1.70.0140.00479.33
8.1.60.0140.00379.33
8.1.50.0150.00479.33
8.1.40.0110.00879.33
8.1.30.0120.00679.33
8.1.20.0120.00679.33
8.1.10.0090.00979.33
8.1.00.0140.00479.33
8.0.300.0000.00721.75
8.0.290.0170.00079.33
8.0.280.0130.00379.33
8.0.270.0090.00779.33
8.0.260.0160.00079.33
8.0.250.0130.00379.33
8.0.240.0110.00579.33
8.0.230.0140.00379.33
8.0.220.0140.00279.33
8.0.210.0140.00579.33
8.0.200.0080.00879.33
8.0.190.0170.00079.33
8.0.180.0080.00879.33
8.0.170.0110.00879.33
8.0.160.0180.00079.33
8.0.150.0110.00579.33
8.0.140.0120.00479.33
8.0.130.0080.00879.33
8.0.120.0100.00779.33
8.0.110.0040.01279.33
8.0.100.0080.00879.33
8.0.90.0090.00979.33
8.0.80.0140.00379.33
8.0.70.0180.00079.33
8.0.60.0170.00079.33
8.0.50.0170.00079.33
8.0.30.0060.01179.33
8.0.20.0160.00079.33
8.0.10.0110.00679.33

preferences:
36.75 ms | 403 KiB | 5 Q