3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'SIM UMTS ITALIA 15.5" BLACK'; echo preg_replace('/^.*?(\d[\d.]*)".*$/', '$1', $str) . "\n"; $from = " "; $to = '"'; function getStringBetween($str,$from,$to){ return preg_replace("/^.*$from([^$from]+)$to.*$/", '$1', $str); } echo getStringBetween($str, $from, $to);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oesaR
function name:  (null)
number of ops:  17
compiled vars:  !0 = $str, !1 = $from, !2 = $to
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'SIM+UMTS+ITALIA+15.5%22+BLACK'
    3     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5E.%2A%3F%28%5Cd%5B%5Cd.%5D%2A%29%22.%2A%24%2F'
          3        SEND_VAL                                                 '%241'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        CONCAT                                           ~5      $4, '%0A'
          7        ECHO                                                     ~5
    5     8        ASSIGN                                                   !1, '+'
    6     9        ASSIGN                                                   !2, '%22'
   12    10        INIT_FCALL                                               'getstringbetween'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !1
         13        SEND_VAR                                                 !2
         14        DO_FCALL                                      0  $8      
         15        ECHO                                                     $8
         16      > RETURN                                                   1

Function getstringbetween:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oesaR
function name:  getStringBetween
number of ops:  17
compiled vars:  !0 = $str, !1 = $from, !2 = $to
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    9     3        INIT_FCALL                                               'preg_replace'
          4        ROPE_INIT                                     7  ~4      '%2F%5E.%2A'
          5        ROPE_ADD                                      1  ~4      ~4, !1
          6        ROPE_ADD                                      2  ~4      ~4, '%28%5B%5E'
          7        ROPE_ADD                                      3  ~4      ~4, !1
          8        ROPE_ADD                                      4  ~4      ~4, '%5D%2B%29'
          9        ROPE_ADD                                      5  ~4      ~4, !2
         10        ROPE_END                                      6  ~3      ~4, '.%2A%24%2F'
         11        SEND_VAL                                                 ~3
         12        SEND_VAL                                                 '%241'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $8      
         15      > RETURN                                                   $8
   10    16*     > RETURN                                                   null

End of function getstringbetween

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.07 ms | 1017 KiB | 15 Q