3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'hellolleh'; function up($str) { return substr($str,0,(1+strlen($str))/2); } echo up($str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BuW7K
function name:  (null)
number of ops:  6
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'hellolleh'
    9     1        INIT_FCALL                                               'up'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function up:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BuW7K
function name:  up
number of ops:  11
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        STRLEN                                           ~1      !0
          5        ADD                                              ~2      1, ~1
          6        DIV                                              ~3      ~2, 2
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                         $4      
          9      > RETURN                                                   $4
    7    10*     > RETURN                                                   null

End of function up

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.87 ms | 1397 KiB | 16 Q