3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Car { public $km = 0; public function drive($distance) { $km += $distance; } public function getKm() { return $km; } } $lexus = new Car(); $lexus->drive(5); print $lexus->getKm();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FUUE3
function name:  (null)
number of ops:  10
compiled vars:  !0 = $lexus
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'Car'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'drive'
          4        SEND_VAL_EX                                              5
          5        DO_FCALL                                      0          
   18     6        INIT_METHOD_CALL                                         !0, 'getKm'
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
          9      > RETURN                                                   1

Class Car:
Function drive:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FUUE3
function name:  drive
number of ops:  3
compiled vars:  !0 = $distance, !1 = $km
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OP                                     1          !1, !0
    9     2      > RETURN                                                   null

End of function drive

Function getkm:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FUUE3
function name:  getKm
number of ops:  2
compiled vars:  !0 = $km
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   !0
   13     1*     > RETURN                                                   null

End of function getkm

End of class Car.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.22 ms | 1393 KiB | 13 Q