3v4l.org

run code in 300+ PHP versions simultaneously
<?php $comentario = '/** * @var string * @Assert\NotBlank(message = "El nombre no puede estar vacío") * @Assert\Regex(pattern="/^ /", match = false, message="El nombre no puede empezar con espacios") * @Assert\Regex(pattern="/ $/", match = false, message="El nombre no puede terminar con espacios") */'; preg_match_all( '/Assert\\\(?P<nombre>\w+)\((.+)\)\s*/m', $comentario, $assert ); //preg_match_all( '/Assert\\\(?P<nombre>\w+)\((?P<parametros>\w+)\)\s*/m', $comentario, $assert ); var_dump($assert); foreach($assert['nombre'] as $row_html) { echo $row_html.'\n'; } /* $cadena = 'foobar: 2008'; preg_match_all('/(?P<nombre>\w+): (?P<digito>\d+)/', $cadena, $coincidencias); var_dump($coincidencias); */
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { [0]=> array(3) { [0]=> string(66) "Assert\NotBlank(message = "El nombre no puede estar vacío") " [1]=> string(100) "Assert\Regex(pattern="/^ /", match = false, message="El nombre no puede empezar con espacios") " [2]=> string(101) "Assert\Regex(pattern="/ $/", match = false, message="El nombre no puede terminar con espacios") " } ["nombre"]=> array(3) { [0]=> string(8) "NotBlank" [1]=> string(5) "Regex" [2]=> string(5) "Regex" } [1]=> array(3) { [0]=> string(8) "NotBlank" [1]=> string(5) "Regex" [2]=> string(5) "Regex" } [2]=> array(3) { [0]=> string(43) "message = "El nombre no puede estar vacío"" [1]=> string(80) "pattern="/^ /", match = false, message="El nombre no puede empezar con espacios"" [2]=> string(81) "pattern="/ $/", match = false, message="El nombre no puede terminar con espacios"" } } NotBlank\nRegex\nRegex\n

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:
31.12 ms | 403 KiB | 8 Q