3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { protected $name; protected $last_ip; public function __construct($name) { $this->name = $name; } public function setLastIp($ip) { $this->last_ip = $ip; } public function getLastIp() { return $this->last_ip; } } interface EntityManagerInterface { public function persist($entity); public function flush($entity = null); } interface UserManagerInterface { public function recordLogin(User $user,$ip); } class UserManagerTest extends PHPUnit_test_case { public function testRecordLogin() { $entity_manager = $this->getMockBuilder('EntityManagerInterface') ->expects($this->method('persist'))->once() ->expects($this->method('flush'))->once(); $test_user = new User('User name'); $test_ip = '127.111.111.111'; $test_manager = new UserManager($entity_manager); $test_manager->recordLogin($test_user, $test_ip); $this->assertEquals($test_ip, $test_user->getLastIp()); } }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "PHPUnit_test_case" not found in /in/Nn76d:42 Stack trace: #0 {main} thrown in /in/Nn76d on line 42
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
56.52 ms | 401 KiB | 8 Q