3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $labels='blaat'; function loadDatabaseLabels($labels){ $labels->labels = array("foo","bar","baz"); return $labels; } function getLabel($labels){ var_dump($labels->label); } $labels = loadDatabaseLabels($labels); getLabel($labels);
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/1gcfY
function name:  (null)
number of ops:  11
compiled vars:  !0 = $labels
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   ASSIGN                                                   !0, 'blaat'
   4     1        NOP                                                      
   9     2        NOP                                                      
  13     3        INIT_FCALL                                               'loaddatabaselabels'
         4        SEND_VAR                                                 !0
         5        DO_FCALL                                      0  $2      
         6        ASSIGN                                                   !0, $2
  14     7        INIT_FCALL                                               'getlabel'
         8        SEND_VAR                                                 !0
         9        DO_FCALL                                      0          
        10      > RETURN                                                   1

Function loaddatabaselabels:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/1gcfY
function name:  loadDatabaseLabels
number of ops:  5
compiled vars:  !0 = $labels
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   RECV                                             !0      
   5     1        ASSIGN_OBJ                                               !0, 'labels'
         2        OP_DATA                                                  <array>
   6     3      > RETURN                                                   !0
   7     4*     > RETURN                                                   null

End of function loaddatabaselabels

Function getlabel:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/1gcfY
function name:  getLabel
number of ops:  6
compiled vars:  !0 = $labels
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   9     0  E >   RECV                                             !0      
  10     1        INIT_FCALL                                               'var_dump'
         2        FETCH_OBJ_R                                      $1      !0, 'label'
         3        SEND_VAR                                                 $1
         4        DO_ICALL                                                 
  11     5      > RETURN                                                   null

End of function getlabel

Generated using Vulcan Logic Dumper, using php 7.2.0