Skip to content

Instantly share code, notes, and snippets.

@imme-emosol
Last active March 20, 2020 00:15
Show Gist options
  • Save imme-emosol/6abb0bc593880e39077397fc957bc5ae to your computer and use it in GitHub Desktop.
Save imme-emosol/6abb0bc593880e39077397fc957bc5ae to your computer and use it in GitHub Desktop.
dump line.
<?php
###
$var = 'var' ;\var_dump(basename(__FILE__,'php').__LINE__);\var_dump(\is_string($var)?${$var}:$var);\exit();
$var = &$this ;\var_dump(basename(__FILE__,'php').__LINE__);\var_dump(\is_string($var)?${$var}:$var);\exit();
# TODO ; automatically fetch first variable occuring before $var .
### "guaranteed" unique ? :
${\md5(__FILE__.__LINE__).'var'}= 'var' ;\var_dump(\basename(__FILE__,'php').__LINE__);\var_dump(\is_string(${\md5(__FILE__.__LINE__).'var'})?${${\md5(__FILE__.__LINE__).'var'}}:${\md5(__FILE__.__LINE__).'var'});\exit();
${\md5(__FILE__.__LINE__).'var'}= &$this ;\var_dump(\basename(__FILE__,'php').__LINE__);\var_dump(\is_string(${\md5(__FILE__.__LINE__).'var'})?${${\md5(__FILE__.__LINE__).'var'}}:${\md5(__FILE__.__LINE__).'var'});\exit();
###
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment