3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = '10 x 2,5'; echo preg_replace_callback('/(\d+(?:[.,]\d+)?)\h*x\h*(\d+(?:[.,]\d+)?)/', function($match) { return str_replace(',' , '.', $match[1]) * str_replace(',' , '.', $match[2]); }, $data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I82Gt
function name:  (null)
number of ops:  9
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '10+x+2%2C5'
    3     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%28%5Cd%2B%28%3F%3A%5B.%2C%5D%5Cd%2B%29%3F%29%5Ch%2Ax%5Ch%2A%28%5Cd%2B%28%3F%3A%5B.%2C%5D%5Cd%2B%29%3F%29%2F'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FI82Gt%3A3%240'
    5     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FI82Gt%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I82Gt
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAL                                                 '.'
          4        FETCH_DIM_R                                      ~1      !0, 1
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                         $2      
          7        INIT_FCALL                                               'str_replace'
          8        SEND_VAL                                                 '%2C'
          9        SEND_VAL                                                 '.'
         10        FETCH_DIM_R                                      ~3      !0, 2
         11        SEND_VAL                                                 ~3
         12        DO_ICALL                                         $4      
         13        MUL                                              ~5      $2, $4
         14      > RETURN                                                   ~5
    5    15*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FI82Gt%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.17 ms | 1400 KiB | 17 Q