3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Tell mysqli to throw an exception if an error occurs */ mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* The table engine has to support transactions */ $mysqli->query("CREATE TABLE IF NOT EXISTS `language` ( Code text NOT NULL, Speakers int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"); /* Start transaction */ $mysqli->begin_transaction(); /* Insert some values */ $mysqli->query("INSERT INTO language(Code, Speakers) VALUES ('DE', 42000123)"); /* Try to insert invalid values */ $language_code = 'FR'; $native_speakers = 'Unknown'; $stmt = $mysqli->prepare('INSERT INTO language VALUES (?,?)'); $stmt->bind_param('ss', $language_code, $native_speakers); $stmt->execute(); /* If code reaches this point without errors then commit the data in database */ $mysqli->commit();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WiCEu
function name:  (null)
number of ops:  37
compiled vars:  !0 = $mysqli, !1 = $language_code, !2 = $native_speakers, !3 = $stmt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL_BY_NAME                                       'mysqli_report'
          1        FETCH_CONSTANT                                   ~4      'MYSQLI_REPORT_ERROR'
          2        FETCH_CONSTANT                                   ~5      'MYSQLI_REPORT_STRICT'
          3        BW_OR                                            ~6      ~4, ~5
          4        SEND_VAL_EX                                              ~6
          5        DO_FCALL                                      0          
    6     6        NEW                                              $8      'mysqli'
          7        SEND_VAL_EX                                              'localhost'
          8        SEND_VAL_EX                                              'my_user'
          9        SEND_VAL_EX                                              'my_password'
         10        SEND_VAL_EX                                              'world'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !0, $8
    9    13        INIT_METHOD_CALL                                         !0, 'query'
         14        SEND_VAL_EX                                              'CREATE+TABLE+IF+NOT+EXISTS+%60language%60+%28%0A%09Code+text+NOT+NULL%2C%0A%09Speakers+int%2811%29+NOT+NULL%0A++%29+ENGINE%3DInnoDB+DEFAULT+CHARSET%3Dutf8mb4%3B'
         15        DO_FCALL                                      0          
   15    16        INIT_METHOD_CALL                                         !0, 'begin_transaction'
         17        DO_FCALL                                      0          
   18    18        INIT_METHOD_CALL                                         !0, 'query'
         19        SEND_VAL_EX                                              'INSERT+INTO+language%28Code%2C+Speakers%29+VALUES+%28%27DE%27%2C+42000123%29'
         20        DO_FCALL                                      0          
   21    21        ASSIGN                                                   !1, 'FR'
   22    22        ASSIGN                                                   !2, 'Unknown'
   23    23        INIT_METHOD_CALL                                         !0, 'prepare'
         24        SEND_VAL_EX                                              'INSERT+INTO+language+VALUES+%28%3F%2C%3F%29'
         25        DO_FCALL                                      0  $16     
         26        ASSIGN                                                   !3, $16
   24    27        INIT_METHOD_CALL                                         !3, 'bind_param'
         28        SEND_VAL_EX                                              'ss'
         29        SEND_VAR_EX                                              !1
         30        SEND_VAR_EX                                              !2
         31        DO_FCALL                                      0          
   25    32        INIT_METHOD_CALL                                         !3, 'execute'
         33        DO_FCALL                                      0          
   28    34        INIT_METHOD_CALL                                         !0, 'commit'
         35        DO_FCALL                                      0          
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.04 ms | 1395 KiB | 13 Q