3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?php namespace PokerHand; use PHPUnit\Framework\TestCase; class PokerHandTest extends TestCase { /** * @test */ public function itCanRankARoyalFlush() { $hand = new PokerHand('As Ks Qs Js 10s'); $this->assertEquals('Royal Flush', $hand->getRank()); } /** * @test */ public function itCanRankAStraightFlush() { $hand = new PokerHand('8s 7s 6s 5s 4s'); $this->assertEquals('Straight Flush', $hand->getRank()); } /** * @test */ public function itCanRankAFourOfAKind() { $hand = new PokerHand('Js Jc Jd Jh 7s'); $this->assertEquals('Four of a Kind', $hand->getRank()); } /** * @test */ public function itCanRankFullHouse() { $hand = new PokerHand('10s 10d 10c 9s 9d'); $this->assertEquals('Full House', $hand->getRank()); } /** * @test */ public function itCanRankAFlush() { $hand = new PokerHand('Kh Qh 6h 2h 9h'); $this->assertEquals('Flush', $hand->getRank()); } /** * @test */ public function itCanRankAStraight() { $hand = new PokerHand('9c 8d 7s 6d 5h'); $this->assertEquals('Straight', $hand->getRank()); } /** * @test */ public function itCanRankAThreeOfAKindh() { $hand = new PokerHand('7c 7d 7s Ks 3s'); $this->assertEquals('Three of a Kind', $hand->getRank()); } /** * @test */ public function itCanRankATwoPair() { $hand = new PokerHand('Kh Kc 3s 3h 2d'); $this->assertEquals('Two Pair', $hand->getRank()); } /** * @test */ public function itCanRankAOnePair() { $hand = new PokerHand('Ah As 10c 7d 6s'); $this->assertEquals('One Pair', $hand->getRank()); } /** * @test */ public function itCanRankAHighCard() { $hand = new PokerHand('9h 6c 7d 2s Qh'); $this->assertEquals('High Card', $hand->getRank()); } } $ composer test-poker > phpunit --verbose --colors=always test/PokerHandTest.php .......... 10 / 10 (100%) Time: 50 ms, Memory: 4.00MB OK (10 tests, 10 assertions)

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)
7.3.40.0110.00914.76
7.3.30.0170.00314.74
7.3.20.0120.00916.58
7.3.10.0090.01216.54
7.3.00.0030.02016.41
7.2.170.0070.01414.72
7.2.160.0080.01114.79
7.2.150.0190.00316.41
7.2.140.0100.00716.45
7.2.130.0030.02216.68
7.2.120.0060.00916.66
7.2.110.0090.00616.57
7.2.100.0130.00916.54
7.2.90.0060.00616.93
7.2.80.0030.00916.44
7.2.70.0040.00816.73
7.2.60.0090.01316.73
7.2.50.0130.00016.72
7.2.40.0070.00316.37
7.2.30.0090.00316.68
7.2.20.0150.00916.60
7.2.10.0160.00616.79
7.2.00.0100.00616.35
7.1.280.0120.00815.49
7.1.270.0100.01015.46
7.1.260.0100.00015.50
7.1.250.0100.01415.35

preferences:
146.4 ms | 1394 KiB | 7 Q