3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace App\W\A\F\D\E\Q; class obj999 implements Serializable { private $data; public function __construct() { $this->data[] = "My private data1"; } public function serialize() { return serialize($this->data); } public function unserialize($data) { $this->data = unserialize($data); } public function getData() { return $this->data; } } $obj = new obj999; $ser = serialize($obj); print_r($ser); echo PHP_EOL; print_r(serialize(["My private data1"]));
based on lIldL
Output for 5.4.2 - 7.2.0
Fatal error: Interface 'App\W\A\F\D\E\Q\Serializable' not found in /in/u3JJT on line 5
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/u3JJT on line 26
Process exited with code 255.