<?php
example_boot();
// Becomes
Drupal\Module\Example\Hook\System::boot();
example_menu();
// Becomes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ± |donate ✓| → php -a | |
| Interactive shell | |
| php > $truck = new stdClass(); | |
| php > $truck->var = TRUE; | |
| php > if ($truck->non) { | |
| php { echo 'Yo'; | |
| php { } | |
| PHP Notice: Undefined property: stdClass::$non in php shell code on line 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ○ → sudo pear list -a | |
| Installed packages, channel __uri: | |
| ================================== | |
| (no packages installed) | |
| Installed packages, channel components.ez.no: | |
| ============================================= | |
| Package Version State | |
| Base 1.8 stable | |
| ConsoleTools 1.6.1 stable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require_once trim(`which phpunit`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Fatal error: Uncaught exception 'ErrorException' with message 'Notice: Undefined variable: undefined_var in /srv/www/current/www/sites/all/modules/allplayers/misc/misc.module line 14' in /srv/www/current/www/sites/all/libraries/Symfony/src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php:65 | |
| Stack trace: | |
| #0 /srv/www/current/www/sites/all/modules/allplayers/misc/misc.module(14): Symfony\Component\HttpKernel\Debug\ErrorHandler->handle(8, 'Undefined varia...', '/srv/www/curren...', 14, Array) | |
| #1 [internal function]: misc_boot() | |
| #2 /srv/www/current/www/includes/module.inc(512): call_user_func_array('misc_boot', Array) | |
| #3 /srv/www/current/www/includes/bootstrap.inc(748): module_invoke('misc', 'boot') | |
| #4 /srv/www/current/www/includes/bootstrap.inc(1511): bootstrap_invoke_all('boot') | |
| #5 /srv/www/current/www/includes/bootstrap.inc(1411): _drupal_bootstrap(5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * This is untested. | |
| */ | |
| class PermissionTest { | |
| /** | |
| * @expectedException PHPUnit_Assertion_Failed | |
| */ | |
| public function testSomePerm() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| while (apci_auto_schedule_events_batch_continue()) { | |
| // Cleanup | |
| db_query('UPDATE queue SET expire = 0'); | |
| drupal_queue_cron_run(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| php > $tz = new DateTimeZone('America/Chicago'); | |
| php > var_dump($tz->getLocation()); | |
| array(4) { | |
| ["country_code"]=> | |
| string(2) "US" | |
| ["latitude"]=> | |
| float(41.85) | |
| ["longitude"]=> | |
| float(-87.65) | |
| ["comments"]=> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function test($x, $y, $z) { | |
| var_dump(($x || $y) && ($z || $y)); | |
| var_dump(($x && $z) || $y); | |
| } | |
| test(TRUE, TRUE, TRUE); | |
| test(TRUE, FALSE, TRUE); | |
| test(TRUE, TRUE, FALSE); | |
| test(FALSE, FALSE, TRUE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ○ → php -a | |
| Interactive shell | |
| php > $var = array(); | |
| php > $var[NULL] = "NULL"; | |
| php > $var[0] = "0"; | |
| php > $var[FALSE] = "FALSE"; | |
| php > $var[''] = "''"; | |
| php > var_dump($var); | |
| array(2) { |