3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 'straat 1 2'; $lastPos = strrpos($foo, ' '); var_dump([ 'start' => trim(substr($foo, 0, $lastPos)), 'end' => trim(substr($foo, $lastPos)), ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TSaDq
function name:  (null)
number of ops:  27
compiled vars:  !0 = $foo, !1 = $lastPos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'straat+1+2'
    4     1        INIT_FCALL                                               'strrpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '+'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    5     6        INIT_FCALL                                               'var_dump'
    6     7        INIT_FCALL                                               'trim'
          8        INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 0
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $5      
         13        SEND_VAR                                                 $5
         14        DO_ICALL                                         $6      
         15        INIT_ARRAY                                       ~7      $6, 'start'
    7    16        INIT_FCALL                                               'trim'
         17        INIT_FCALL                                               'substr'
         18        SEND_VAR                                                 !0
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $8      
         21        SEND_VAR                                                 $8
         22        DO_ICALL                                         $9      
         23        ADD_ARRAY_ELEMENT                                ~7      $9, 'end'
         24        SEND_VAL                                                 ~7
         25        DO_ICALL                                                 
    8    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.91 ms | 1395 KiB | 21 Q