3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bla = new Bla(); echo ($bla->meh()); class bla { function meh() { $a = 10; for ($i = 0; $i < 999; $i++) { $a++; $a = ($a * 2) + 5; $obj = new bla2; $obj->setOffset($i); $a += $obj->getMeh(); if ($obj->something() === true) { $a += 100; } $obj = null; } return $a; } } class bla2 { protected $offset; function setOffset($offset) { $this->offset = $offset; } function getMeh() { $offset = $this->offset; return ($offset * ($offset / 2)) + 5; } function something() { if ($this->offset % 2 === 0) { return true; } return false; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Sn6pE
function name:  (null)
number of ops:  7
compiled vars:  !0 = $bla
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'Bla'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    5     3        INIT_METHOD_CALL                                         !0, 'meh'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   52     6      > RETURN                                                   1

Class bla:
Function meh:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 3
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 3
Branch analysis from position: 25
Branch analysis from position: 3
Branch analysis from position: 21
filename:       /in/Sn6pE
function name:  meh
number of ops:  27
compiled vars:  !0 = $a, !1 = $i, !2 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, 10
   12     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->23
   13     3    >   PRE_INC                                                  !0
   14     4        MUL                                              ~6      !0, 2
          5        ADD                                              ~7      ~6, 5
          6        ASSIGN                                                   !0, ~7
   16     7        NEW                                              $9      'bla2'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $9
   17    10        INIT_METHOD_CALL                                         !2, 'setOffset'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
   19    13        INIT_METHOD_CALL                                         !2, 'getMeh'
         14        DO_FCALL                                      0  $13     
         15        ASSIGN_OP                                     1          !0, $13
   21    16        INIT_METHOD_CALL                                         !2, 'something'
         17        DO_FCALL                                      0  $15     
         18        TYPE_CHECK                                    8          $15
         19      > JMPZ                                                     ~16, ->21
   22    20    >   ASSIGN_OP                                     1          !0, 100
   25    21    >   ASSIGN                                                   !2, null
   12    22        PRE_INC                                                  !1
         23    >   IS_SMALLER                                               !1, 999
         24      > JMPNZ                                                    ~20, ->3
   28    25    > > RETURN                                                   !0
   29    26*     > RETURN                                                   null

End of function meh

End of class bla.

Class bla2:
Function setoffset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Sn6pE
function name:  setOffset
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   36     1        ASSIGN_OBJ                                               'offset'
          2        OP_DATA                                                  !0
   37     3      > RETURN                                                   null

End of function setoffset

Function getmeh:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Sn6pE
function name:  getMeh
number of ops:  7
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   FETCH_OBJ_R                                      ~1      'offset'
          1        ASSIGN                                                   !0, ~1
   42     2        DIV                                              ~3      !0, 2
          3        MUL                                              ~4      !0, ~3
          4        ADD                                              ~5      ~4, 5
          5      > RETURN                                                   ~5
   43     6*     > RETURN                                                   null

End of function getmeh

Function something:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Sn6pE
function name:  something
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     0  E >   FETCH_OBJ_R                                      ~0      'offset'
          1        MOD                                              ~1      ~0, 2
          2        IS_IDENTICAL                                             ~1, 0
          3      > JMPZ                                                     ~2, ->5
   47     4    > > RETURN                                                   <true>
   50     5    > > RETURN                                                   <false>
   51     6*     > RETURN                                                   null

End of function something

End of class bla2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.95 ms | 1399 KiB | 13 Q