3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Whatever { static $color_palette = array( "strategy-genre" => "#C93939" ); function bg($genre) { echo "Background color is set to " . self::$color_palette[$genre]; echo "\n"; return self::$color_palette[$genre]; } } $inst = new Whatever(); echo $inst -> bg("strategy-genre");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vS3Om
function name:  (null)
number of ops:  8
compiled vars:  !0 = $inst
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'Whatever'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_METHOD_CALL                                         !0, 'bg'
          4        SEND_VAL_EX                                              'strategy-genre'
          5        DO_FCALL                                      0  $4      
          6        ECHO                                                     $4
          7      > RETURN                                                   1

Class Whatever:
Function bg:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vS3Om
function name:  bg
number of ops:  10
compiled vars:  !0 = $genre
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        FETCH_STATIC_PROP_R          unknown             ~1      'color_palette'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3        CONCAT                                           ~3      'Background+color+is+set+to+', ~2
          4        ECHO                                                     ~3
   11     5        ECHO                                                     '%0A'
   12     6        FETCH_STATIC_PROP_R          unknown             ~4      'color_palette'
          7        FETCH_DIM_R                                      ~5      ~4, !0
          8      > RETURN                                                   ~5
   13     9*     > RETURN                                                   null

End of function bg

End of class Whatever.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.82 ms | 1393 KiB | 13 Q