3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class ClassA{ private $nota; public function __construct($n){ $this->nota = $n; } public function showNota(){ echo "Nota: " . $this->nota . "\n"; } } $alunoA1 = new ClassA(10); $alunaA2 = new ClassA(8); $alunoA1->showNota(); $alunoA2->showNota();
based on 8svBc
Output for 7.0.5 - 7.2.0
Nota: 10 Notice: Undefined variable: alunoA2 in /in/hOv3Z on line 20 Fatal error: Uncaught Error: Call to a member function showNota() on null in /in/hOv3Z:20 Stack trace: #0 {main} thrown in /in/hOv3Z on line 20
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Nota: 10 Notice: Undefined variable: alunoA2 in /in/hOv3Z on line 20 Fatal error: Uncaught Error: Call to a member function showNota() on unknown in /in/hOv3Z:20 Stack trace: #0 {main} thrown in /in/hOv3Z on line 20
Process exited with code 255.
Output for 5.6.7 - 5.6.28
Nota: 10 Notice: Undefined variable: alunoA2 in /in/hOv3Z on line 20 Fatal error: Call to a member function showNota() on null in /in/hOv3Z on line 20
Process exited with code 255.
Output for 5.3.18 - 5.5.35
Nota: 10 Notice: Undefined variable: alunoA2 in /in/hOv3Z on line 20 Fatal error: Call to a member function showNota() on a non-object in /in/hOv3Z on line 20
Process exited with code 255.