3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mysqli_real_escape_string($a) { return addslashes($a); } function callStoredProc( $storedProc ) { $args = func_get_args(); $storedProc = array_shift( $args ); array_walk( $args, function( &$item, $key ) { $item = "'" . addslashes( $arg ) . "'"; }); $procCall = sprintf( 'call %s( %s )', $storedProc, implode( ',', $args ) ); var_dump( $procCall ); } callStoredProc( 'something', 1, 'a', 'b\'' );
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $arg in /in/Z9XQX on line 10 Deprecated: addslashes(): Passing null to parameter #1 ($string) of type string is deprecated in /in/Z9XQX on line 10 Warning: Undefined variable $arg in /in/Z9XQX on line 10 Deprecated: addslashes(): Passing null to parameter #1 ($string) of type string is deprecated in /in/Z9XQX on line 10 Warning: Undefined variable $arg in /in/Z9XQX on line 10 Deprecated: addslashes(): Passing null to parameter #1 ($string) of type string is deprecated in /in/Z9XQX on line 10 string(26) "call something( '','','' )"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.88 ms | 402 KiB | 8 Q