3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'cream 100g'; $p = strcspn($str, '0123456789'); $before = substr($str, 0, $p); $after = substr($str, $p); echo "before: $before, after: $after";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hv0jt
function name:  (null)
number of ops:  23
compiled vars:  !0 = $str, !1 = $p, !2 = $before, !3 = $after
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'cream+100g'
    5     1        INIT_FCALL                                               'strcspn'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '0123456789'
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    6     6        INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
    7    12        INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !3, $9
    9    17        ROPE_INIT                                     4  ~12     'before%3A+'
         18        ROPE_ADD                                      1  ~12     ~12, !2
         19        ROPE_ADD                                      2  ~12     ~12, '%2C+after%3A+'
         20        ROPE_END                                      3  ~11     ~12, !3
         21        ECHO                                                     ~11
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.33 ms | 1399 KiB | 17 Q