3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bar(string $str){ $str[0] = "b"; var_dump($str); } $str = ""; $str[0] = "b"; var_dump($str); bar(""); $str = "a"; $str[0] = "b"; var_dump($str); $str = "a"; $str[1] = "b"; var_dump($str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5nKmu
function name:  (null)
number of ops:  22
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, ''
    9     1        ASSIGN_DIM                                               !0, 0
          2        OP_DATA                                                  'b'
   10     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   12     6        INIT_FCALL                                               'bar'
          7        SEND_VAL                                                 ''
          8        DO_FCALL                                      0          
   14     9        ASSIGN                                                   !0, 'a'
   15    10        ASSIGN_DIM                                               !0, 0
         11        OP_DATA                                                  'b'
   16    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
   18    15        ASSIGN                                                   !0, 'a'
   19    16        ASSIGN_DIM                                               !0, 1
         17        OP_DATA                                                  'b'
   20    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5nKmu
function name:  bar
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN_DIM                                               !0, 0
          2        OP_DATA                                                  'b'
    5     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
    6     6      > RETURN                                                   null

End of function bar

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.85 ms | 1399 KiB | 16 Q