3v4l.org

run code in 300+ PHP versions simultaneously
<?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)
based on QRLaY

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.0040.00714.71
7.3.30.0080.01214.61
7.3.20.0050.00916.47
7.3.10.0140.00816.41
7.3.00.0100.00016.59
7.2.170.0040.00814.61
7.2.160.0100.00614.86
7.2.150.0150.00616.82
7.2.140.0060.00616.71
7.2.130.0170.00716.63
7.2.120.0130.01016.68
7.2.110.0110.01116.46
7.2.100.0040.01416.76
7.2.90.0110.01116.77
7.2.80.0040.00816.52
7.2.70.0150.00716.77
7.2.60.0140.00616.80
7.2.50.0120.00916.45
7.2.40.0130.00716.50
7.2.30.0110.00416.87
7.2.20.0070.00716.75
7.2.10.0080.00416.26
7.2.00.0070.00316.67
7.1.280.0000.01015.48
7.1.270.0030.00715.48
7.1.260.0060.00315.52
7.1.250.0030.01715.30