3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Fruit { public $name; public function __construct($n = "Fruit") { $this->name = $n; } public function __destruct() { echo "\nBye bye fruit\n"; } } $fruit = new Fruit("Banana"); echo $fruit->name;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r6EmX
function name:  (null)
number of ops:  7
compiled vars:  !0 = $fruit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Fruit'
          1        SEND_VAL_EX                                              'Banana'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   15     4        FETCH_OBJ_R                                      ~4      !0, 'name'
          5        ECHO                                                     ~4
   16     6      > RETURN                                                   1

Class Fruit:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r6EmX
function name:  __construct
number of ops:  4
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      'Fruit'
    6     1        ASSIGN_OBJ                                               'name'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r6EmX
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     '%0ABye+bye+fruit%0A'
   11     1      > RETURN                                                   null

End of function __destruct

End of class Fruit.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.52 ms | 998 KiB | 13 Q