3v4l.org

run code in 300+ PHP versions simultaneously
<?php class BadAss { function __set($name, $value) { $this->{self::confuse($name)} = $value; } private static function confuse($name) { return substr($name, 0, 4) !== 'bad_' ? "bad_$name" : $name; } } $o = new BadAss; $o->name = 'value'; var_dump($o);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uhclB
function name:  (null)
number of ops:  9
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'BadAss'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        ASSIGN_OBJ                                               !0, 'name'
          4        OP_DATA                                                  'value'
   16     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class BadAss:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uhclB
function name:  __set
number of ops:  8
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_STATIC_METHOD_CALL                                  'confuse'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5        ASSIGN_OBJ                                               $2
          6        OP_DATA                                                  !1
    6     7      > RETURN                                                   null

End of function __set

Function confuse:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uhclB
function name:  confuse
number of ops:  15
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 4
          5        DO_ICALL                                         $1      
          6        IS_NOT_IDENTICAL                                         $1, 'bad_'
          7      > JMPZ                                                     ~2, ->12
          8    >   NOP                                                      
          9        FAST_CONCAT                                      ~3      'bad_', !0
         10        QM_ASSIGN                                        ~4      ~3
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~4      !0
         13    > > RETURN                                                   ~4
   10    14*     > RETURN                                                   null

End of function confuse

End of class BadAss.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.9 ms | 1388 KiB | 17 Q