3v4l.org

run code in 300+ PHP versions simultaneously
<?php #include_once("con.php"); #$db = new Da(); $con = false; $String = "{{ONE}} {{TWO}} {{THREE}} {{FOUR}} {{FIVE}} {{SIX}}"; $new_string = preg_replace_callback('~{{[^}{]+}}~', function($m) use ($con) { $Query = "SELECT link FROM student WHERE linkVal = '".$m[0]."'"; // uncomment var_dump($Query); #$Result = $con->query($Query); #if($row = $Result->fetch(PDO::FETCH_ASSOC)) { # return $row["link"]; #} }, $String); var_dump($new_string); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M7IFD
function name:  (null)
number of ops:  14
compiled vars:  !0 = $con, !1 = $String, !2 = $new_string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <false>
    7     1        ASSIGN                                                   !1, '%7B%7BONE%7D%7D+%7B%7BTWO%7D%7D+%7B%7BTHREE%7D%7D+%7B%7BFOUR%7D%7D+%7B%7BFIVE%7D%7D+%7B%7BSIX%7D%7D'
    9     2        INIT_FCALL                                               'preg_replace_callback'
          3        SEND_VAL                                                 '%7E%7B%7B%5B%5E%7D%7B%5D%2B%7D%7D%7E'
          4        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
          5        BIND_LEXICAL                                             ~5, !0
   19     6        SEND_VAL                                                 ~5
          7        SEND_VAR                                                 !1
    9     8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !2, $6
   21    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
   22    13      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M7IFD
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $m, !1 = $con, !2 = $Query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   11     2        FETCH_DIM_R                                      ~3      !0, 0
          3        CONCAT                                           ~4      'SELECT+link+FROM+student+WHERE+linkVal+%3D+%27', ~3
          4        CONCAT                                           ~5      ~4, '%27'
          5        ASSIGN                                                   !2, ~5
   14     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                                 
   19     9      > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.11 ms | 1006 KiB | 15 Q