3v4l.org

run code in 300+ PHP versions simultaneously
<?php function Conv( $a, $s ) { switch ( $s ) { case 'k': { $s = 1; $t = 'KB'; } break; case 'm': { $s = 2; $t = 'MB'; } break; case 'g': { $s = 3; $t = 'GB'; } break; case 't': { $s = 4; $t = 'TB'; } break; default: { $s = 0; $t = 'B'; } break; } return [ $a * pow( 1024, $s ), $t ]; // gives "A non well formed numeric value encountered" } var_dump( Conv("3", "k") ); var_dump( Conv("3k", "k") );
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> int(3072) [1]=> string(2) "KB" } Warning: A non-numeric value encountered in /in/iPMOV on line 11 array(2) { [0]=> int(3072) [1]=> string(2) "KB" }

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:
58.14 ms | 401 KiB | 8 Q