3v4l.org

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

Class Fruit:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o70Po
function name:  __construct
number of ops:  4
compiled vars:  !0 = $n
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                            !0      'Fruit'
    7     1        ASSIGN_OBJ                                                   'name'
          2        OP_DATA                                                      !0
    8     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/o70Po
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                         '%0ABye+bye+fruit%0A'
   12     1      > RETURN                                                       null

End of function __destruct

End of class Fruit.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
211.75 ms | 1851 KiB | 13 Q