3v4l.org

run code in 300+ PHP versions simultaneously
<?php function assignValuesFromText( $sIn, $dVat = null ){ $aRet = array(); $aPieces = explode( '@@', $sIn ); while ( list( $sKey, $sVal ) = each( $aPieces ) ) { if ( $sVal ) { $aName = explode( '__', $sVal ); if ( isset( $aName[0] ) && isset( $aName[1] ) ) { //$aRet[] = $this->_fillExplodeArray( $aName, $dVat ); } } } return $aRet; } $string = "Schwarz__@@Weiß__@@Schön!P!10__@@Cool!P!50%__@@"; echo print_r(assignValuesFromText($string),true);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function each() in /in/SLG2f:5 Stack trace: #0 /in/SLG2f(18): assignValuesFromText('Schwarz__@@Wei\xC3...') #1 {main} thrown in /in/SLG2f on line 5
Process exited with code 255.

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