3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pdo = new PDO('mysql:dbname=testdb;host=127.0.0.1;charset=utf8mb4', 'local'); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES,false); var_dump($s->execute([1]), $s->fetchall()); /* PHP Warning: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' at line 1 in php shell code:1 Stack trace: #0 php shell code(1): PDOStatement->execute(Array) #1 {main} thrown in php shell code on line 1 */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YMdOX
function name:  (null)
number of ops:  23
compiled vars:  !0 = $pdo, !1 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'PDO'
          1        SEND_VAL_EX                                              'mysql%3Adbname%3Dtestdb%3Bhost%3D127.0.0.1%3Bcharset%3Dutf8mb4'
          2        SEND_VAL_EX                                              'local'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
    4     5        INIT_METHOD_CALL                                         !0, 'setAttribute'
          6        SEND_VAL_EX                                              3
          7        SEND_VAL_EX                                              2
          8        DO_FCALL                                      0          
    5     9        INIT_METHOD_CALL                                         !0, 'setAttribute'
         10        SEND_VAL_EX                                              20
         11        SEND_VAL_EX                                              <false>
         12        DO_FCALL                                      0          
    6    13        INIT_FCALL                                               'var_dump'
         14        INIT_METHOD_CALL                                         !1, 'execute'
         15        SEND_VAL_EX                                              <array>
         16        DO_FCALL                                      0  $7      
         17        SEND_VAR                                                 $7
         18        INIT_METHOD_CALL                                         !1, 'fetchall'
         19        DO_FCALL                                      0  $8      
         20        SEND_VAR                                                 $8
         21        DO_ICALL                                                 
   14    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.91 ms | 1399 KiB | 15 Q