Jared Ahlfeld James Chiddix , 9/8/1972 Santa Rosa/California /United States of America Note: empty array is converted to null by non-strict equal '==' comparison. Use is_null() or '===' if there is possible of getting empty array. $a = array(); $a == null <== return true $a === null < == return false is_null($a) <== return false up down 2 Toycat1 month ago Be careful using NULL together with namespaces. If a NULL constant is redefined in a namespace other than global, you will get unexpected results when comparing to NULL inside the namespace. Instead always use \NULL, \FALSE, and \TRUE when comparing. Otherwise it may lead to application failures and potential security issues where certain checks could be effectively disabled. A simple example to demonstrate the behavior: <?php namespace RedefinedConstants { // redefining global namespace constants has no effect define('NULL', 'I am not global NULL!'); define('TRUE', 'I am not global TRUE!'); define('FALSE', 'I am not global FALSE!'); // redefining local namespace constants will work define('RedefinedConstants\NULL', 'I am not NULL!', \TRUE); define('RedefinedConstants\FALSE', 'I am not FALSE!', \TRUE); define('RedefinedConstants\TRUE', 'I am not TRUE!', \TRUE); var_dump( NULL, \NULL, null, \null, Null, \Null, FALSE, \FALSE, false, \false, False, \False, TRUE, \TRUE, true, \true, True, \True ); } ?> up down 7 nl-x at bita dot nl6 years ago Watch out. You can define a new constant with the name NULL with define("NULL","FOO");. But you must use the function constant("NULL"); to get it's value. NULL without the function call to the constant() function will still retrieve the special type NULL value. Within a class there is no problem, as const NULL="Foo"; will be accessible as myClass::NULL. up down 4 poutri_j at epitech dot net7 years ago if you declare something like this : <?php class toto { public $a = array(); public function load() { if ($this->a == null) // ==> the result is true $a = other_func(); } } ?> be carefull, that's strange but an empty array is considered as a null variable up down 3 rizwan_nawaz786 at hotmail dot com8 years ago Hi Rizwan Here Null is the Constant in PHP. it is use to assign a empty value to the variable like $a=NULL; At this time $a has is NULL or $a has no value; When we declaire a veriable in other languages than that veriable has some value depending on the value of memory location at which it is pointed but in php when we declaire a veriable than php assign a NULL to a veriable. up down 3 foxdie_cs at hotmail dot com11 months ago a quick note about the magic function __get() : <?php class Foo{ protected $bar; public function __construct(){ $this->bar = NULL; var_dump( $this->bar ); //prit 'NULL' but won't call the magic method __get() unset( $this->bar ); var_dump( $this->bar ); //print 'GET bar' and 'NULL' } public function __get( $var ){ echo "GET " . $var; } } new Foo(); ?> up down 0 cdcchen at hotmail dot com7 years ago empty() is_null() !isset() $var = ""; empty($var) is true. is_null($var) is false. !isset($var) is false. up down -1 ryan at trezshard dot com2 years ago This simple shorthand seems to work for setting new variables to NULL: <?php $Var; ?> The above code will set $Var to NULL UPDATE: After further testing it appears the code only works in the global scope and does not work inside functions. <?php function Example(){ $Var; var_dump($Var); } ?> Would not work as expected. up down -1 dward at maidencreek dot com11 years ago Nulls are almost the same as unset variables and it is hard to tell the difference without creating errors from the interpreter: <?php $var = NULL; ?> isset($var) is FALSE empty($var) is TRUE is_null($var) is TRUE isset($novar) is FALSE empty($novar) is TRUE is_null($novar) gives an Undefined variable error $var IS in the symbol table (from get_defined_vars(<?php // $Id$ $_SERVER['BASE_PAGE'] = 'source.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; $SIDEBAR_DATA = ' <h3>Our source is open</h3> <p> The syntax highlighted source is automatically generated by PHP from the plaintext script. If you\'re interested in what\'s behind the several functions we used, you can always take a look at the source of the following files: </p> <ul class="toc"> <li><a href="">prepend.inc</a></li> <li><a href="">site.inc</a></li> <li><a href="">mirrors.inc</a></li> <li><a href="">countries.inc</a></li> <li><a href="">languages.inc</a></li> <li><a href="">langchooser.inc</a></li> <li><a href="">ip-to-country.inc</a></li> <li><a href="">layout.inc</a></li> <li><a href="">last_updated.inc</a></li> <li><a href="">shared-manual.inc</a></li> <li><a href="">manual-lookup.inc</a></li> </ul> <p> Of course, if you want to see the <a href="">source of this page</a>, we have it available. You can also browse the Git repository for this website on <a href=""http://git.php.net/?p=web/php.git;a=summary">http://git.php.net/?p=web/php.git;a=summary">git.php.net</a>. </p> '; site_header("Show Source", array("current" => "community")); // No file param specified if (!isset($_GET['url']) || (isset($_GET['url']) && !is_string($_GET['url']))) { echo "<h1>No page URL specified</h1>"; site_footer(); exit; } echo "<h1>Source of: " . htmlentities($_GET['url'], ENT_IGNORE, 'UTF-8') . "</h1>"; // Get dirname of the specified URL part $dir = dirname($_GET['url']); // Some dir was present in the filename if (!empty($dir) && !preg_match("!^(\\.|/)$!", $dir)) { // Check if the specified dir is valid $legal_dirs = array("/manual", "/include", "/stats", "/error", "/license", "/conferences", "/archive", "/releases", "/security", "/reST"); if ((preg_match("!^/manual/!", $dir) || in_array($dir, $legal_dirs)) && strpos($dir, "..") === FALSE) { $page_name = $_SERVER['DOCUMENT_ROOT'] . $_GET['url']; } else { $page_name = FALSE; } } else { $page_name = $_SERVER['DOCUMENT_ROOT'] . '/' . basename($_GET['url']); } // Provide some feedback based on the file found if (!$page_name || @is_dir($page_name)) { echo "<p>Invalid file or folder specified</p>\n"; } elseif (file_exists($page_name)) { highlight_php(join("", file($page_name))); } else { echo "<p>This file does not exist.</p>\n"; } site_footer();)) $var CAN be used as an argument or an _expression_. So, in most cases I found that we needed to use !isset($var) intead of is_null($var) and then set $var = NULL if the variable needs to be used later to guarantee that $var is a valid variable with a NULL value instead of being undefined. up down -4 Anonymous7 years ago // Difference between "unset($a);" and "$a = NULL;" : <?php // unset($a) $a = 5; $b = & $a; unset($a); print "b $b "; // b 5 // $a Enjoy this limited preview of the ESV Literary Study Bible. 1 Chronicles 4 « 1 Chronicles 3 | 1 Chronicles 4 | 1 Chronicles 5 » Descendants of Judah and Simeon [ chapter 4 ]. Now it emerges that the lineage of David in chapter 3 was an insertion into the genealogies of the sons of Jacob. The families of Judah and Simeon are recorded in chapter 4. We get more than a mere listing of names in this chapter, though. From time to time the compiler adds hints of a story that tease us into wondering what the larger picture is. 4:1 The sons of Judah: Perez, Hezron, Carmi, Hur, and Shobal. 2 Reaiah the son of Shobal fathered Jahath, and Jahath fathered Ahumai and Lahad. These were the clans of the Zorathites. 3 These were the sons 1 of Etam: Jezreel, Ishma, and Idbash; and the name of their sister was Hazzelelponi, 4 and Penuel fathered Gedor, and Ezer fathered Hushah. These were the sons of Hur, the firstborn of Ephrathah, the father of Bethlehem. 5 Ashhur, the father of Tekoa, had two wives, Helah and Naarah; 6 Naarah bore him Ahuzzam, Hepher, Temeni, and Haahashtari. These were the sons of Naarah. 7 The sons of Helah: Zereth, Izhar, and Ethnan. 8 Koz fathered Anub, Zobebah, and the clans of Aharhel, the son of Harum. 9 Jabez was more honorable than his brothers; and his mother called his name Jabez, saying, “Because I bore him in pain.” 2 10 Jabez called upon the God of Israel, saying, “Oh that you would bless me and enlarge my border, and that your hand might be with me, and that you would keep me from harm 3 so that it might not bring me pain!” And God granted what he asked. 11 Chelub, the brother of Shuhah, fathered Mehir, who fathered Eshton. 12 Eshton fathered Beth-rapha, Paseah, and Tehinnah, the father of Ir-nahash. These are the men of Recah. 13 The sons of Kenaz: Othniel and Seraiah; and the sons of Othniel: Hathath and Meonothai. 4 14 Meonothai fathered Ophrah; and Seraiah fathered Joab, the father of Ge-harashim, 5 so-called because they were craftsmen. 15 The sons of Caleb the son of Jephunneh: Iru, Elah, and Naam; and the son 6 of Elah: Kenaz. 16 The sons of Jehallelel: Ziph, Ziphah, Tiria, and Asarel. 17 The sons of Ezrah: Jether, Mered, Epher, and Jalon. These are the sons of Bithiah, the daughter of Pharaoh, whom Mered married; 7 and she conceived and bore 8 Miriam, Shammai, and Ishbah, the father of Eshtemoa. 18 And his Judahite wife bore Jered the father of Gedor, Heber the father of Soco, and Jekuthiel the father of Zanoah. 19 The sons of the wife of Hodiah, the sister of Naham, were the fathers of Keilah the Garmite and Eshtemoa the Maacathite. 20 The sons of Shimon: Amnon, Rinnah, Ben-hanan, and Tilon. The sons of Ishi: Zoheth and Ben-zoheth. 21 The sons of Shelah the son of Judah: Er the father of Lecah, Laadah the father of Mareshah, and the clans of the house of linen workers at Beth-ashbea; 22 and Jokim, and the men of Cozeba, and Joash, and Saraph, who ruled in Moab and returned to Lehem 9 (now the records 10 are ancient). 23 These were the potters who were inhabitants of Netaim and Gederah. They lived there in the king's service. 24 The sons of Simeon: Nemuel, Jamin, Jarib, Zerah, Shaul; 25 Shallum was his son, Mibsam his son, Mishma his son. 26 The sons of Mishma: Hammuel his son, Zaccur his son, Shimei his son. 27 Shimei had sixteen sons and six daughters; but his brothers did not have many children, nor did all their clan multiply like the men of Judah. 28 They lived in Beersheba, Moladah, Hazar-shual, 29 Bilhah, Ezem, Tolad, 30 Bethuel, Hormah, Ziklag, 31 Beth-marcaboth, Hazar-susim, Beth-biri, and Shaaraim. These were their cities until David reigned. 32 And their villages were Etam, Ain, Rimmon, Tochen, and Ashan, five cities, 33 along with all their villages that were around these cities as far as Baal. These were their settlements, and they kept a genealogical record. 34 Meshobab, Jamlech, Joshah the son of Amaziah, 35 Joel, Jehu the son of Joshibiah, son of Seraiah, son of Asiel, 36 Elioenai, Jaakobah, Jeshohaiah, Asaiah, Adiel, Jesimiel, Benaiah, 37 Ziza the son of Shiphi, son of Allon, son of Jedaiah, son of Shimri, son of Shemaiah— 38 these mentioned by name were princes in their clans, and their fathers' houses increased greatly. 39 They journeyed to the entrance of Gedor, to the east side of the valley, to seek pasture for their flocks, 40 where they found rich, good pasture, and the land was very broad, quiet, and peaceful, for the former inhabitants there belonged to Ham. 41 These, registered by name, came in the days of Hezekiah, king of Judah, and destroyed their tents and the Meunites who were found there, and marked them for destruction to this day, and settled in their place, because there was pasture there for their flocks. 42 And some of them, five hundred men of the Simeonites, went to Mount Seir, having as their leaders Pelatiah, Neariah, Rephaiah, and Uzziel, the sons of Ishi. 43 And they defeated the remnant of the Amalekites who had escaped, and they have lived there to this day. Footnotes 1 4:3 Septuagint (compare Vulgate); Hebrew father 2 4:9 Jabez sounds like the Hebrew for pain 3 4:10 Or evil 4 4:13 Septuagint, Vulgate; Hebrew lacks Meonothai 5 4:14 Ge-harashim means valley of craftsmen 6 4:15 Hebrew sons 7 4:17 The clause These are . . . married is transposed from verse 18 8 4:17 Hebrew lacks and bore 9 4:22 Vulgate (compare Septuagint); Hebrew and Jashubi-lahem 10 4:22 Or matters « 1 Chronicles 3 | 1 Chronicles 4 | 1 Chronicles 5 » Copyright ©2007 Crossway Bibles. The Holy Bible, English Standard Version copyright ©2001 by Crossway Bibles, a publishing ministry of Good News Publishers. Used by permission. All rights reserved. Quotation information. Literary Study Bible notes copyright ©2007.PHP: NULL - Manual var_dump ( $this-> bar ); //print 'GET bar' and 'NULL' } public function __get ( $var ){ echo "GET " . $var; } } new Foo (); ?> up. down. 0 cdcchen at ... android - getActionBar returns null - Stack Overflow Last updated: Apr 05, 2012 · 2 posts · First post: Apr 05, 2012 Calling getActionBar returns null. This has been frequently reported so I've made sure to include the solutions others have used: My minSdkVersion is 11, I DO have a ... android - getActionBar() returns null - Stack OverflowFeb 28, 2012 android - getAction Bar gives null pointer exception - Stack OverflowFeb 14, 2013 android - GetSupportActionBar return null - Stack OverflowApr 16, 2013 C# get type of null object - Stack Overflow Foo bar; bar = null; Type myType = GetDeclaredType(bar); } I posted this also at a similar topic, I hope it's of any use for you. ;-) share | improve this answer. PHP: NULL - Manual - PHP: Hypertext Preprocessor var_dump ( $this-> bar ); //print 'GET bar' and 'NULL' } public function __get ( $var ){ echo "GET " . $var; } } new Foo (); ?> up. down. 0 Toycat ¶ 1 ... Unable to prove Contract.Requires(bar == null || baz.Id == bar… social.msdn.microsoft.com › … › DevLabs Forums › Code Contracts Oct 11, 2011 · I have have run into an interesting case in which no matter what I do I cannot seem to prove a precondition in the form Contract.Requires(bar == null ... getActionBar() returns null - RSS aggregation for java topic blogs www.rss4java.com/17945-getActionBar()-returns-null.aspx I'm having an odd problem. I am making an app with targetsdk 13. In my main activity's onCreate method i call getActionBar() to setup my actionbar. Posting a bulletin ...shows bar * * * NULL * * * - Google Product ... Posting a bulletin ...shows bar * * * NULL * * * djmambito: 8/19/10 3:22 PM: What bullshit problem is this again. I try to post a bulletin ...that new feature we have. Data manipulation API - MoodleDocs o $DB-> count_records_sql ($sql, array $params = null) /// Get the result of an SQL SELECT COUNT ... $result = $DB-> get_records ($table, array ('foo' => 'bar'), null ... Null point on a bar magnet - SciForums.com 34 replies since January 2009 Say we look at a conventional ferr. bar magnet. We have a south pole and we have a ... There is no null point. The magnetic field lies around a bar magnet form closed ... 1Table of Contents PHP Systems Machine Status FreeBSD upgrades PHP Systems PHP is supported by a number of machines provided by a number of generous sponsors. This is a basic inventory of those machines and what services they provide. Machine Status We use Nagios and Munin to monitor the machines. There is a public network status page as well as a protected area (log in with your SVN credentials) with more detailed information. The Munin web interface is available here. FreeBSD upgrades Note regarding {Free(BSD) machines}: Upgrades should be performed according to this guide. Mirror Sites Listed below are the official, active, and fully functional PHP.net mirrors. Some mirrors might be missing from this list because mirrors are automatically deactivated when problems arise. Mirrors are continuously checked and reactivated when appropriate. We suggest you choose a PHP.net mirror that is geographically close to you. All mirrors provide identical features and services, with the only difference being the increased speed that close mirrors provide. Your current mirror is highlighted in the list below. If you are interested in hosting a mirror of this site, read our mirroring page. Armenia Australia Austria Bangladesh Belgium Brazil Bulgaria Canada Chile Czech Republic Denmark Estonia Finland France Germany Greece Hong Kong Hungary Iceland India Iran Ireland Israel Italy Jamaica Japan Latvia Liechtenstein Lithuania Luxembourg Malaysia Mexico Netherlands New Caledonia New Zealand Norway Pakistan Panama Poland Portugal Republic of Korea Republic of Moldova Romania Singapore Slovenia Spain Sweden Switzerland Taiwan Thailand Turkey Ukraine United Kingdom United Republic of Tanzania United States <VirtualHost *-or-your-hostname-or-your-ip-here> <Directory /www/htdocs/phpweb> # Do not display directory listings if index is not present, # and do not try to match filenames if extension is omitted Options -Indexes -MultiViews </Directory> ServerName ccx.php.net ServerAdmin yourname@example.com UseCanonicalName On # Webroot of PHP mirror site DocumentRoot /www/htdocs/phpweb # Log server activity ErrorLog logs/error_log TransferLog logs/access_log # Set directory index DirectoryIndex index.php index.html # Handle errors with local error handler script ErrorDocument 401 /error.php ErrorDocument 403 /error.php ErrorDocument 404 /error.php # Add types not specified by Apache by default AddType application/octet-stream .chm .bz2 .tgz .msi AddType application/x-pilot .prc .pdb # Set mirror's preferred language here SetEnv MIRROR_LANGUAGE "en" # The next two lines are only necessary if generating # stats (see below), otherwise you should comment them out Alias /stats/ /path/to/local/stats/ SetEnv MIRROR_STATS 1 # Apache2 has 'AddHandler type-map var' enabled by default. # Remove the comment sign on the line below if you have it enabled. # RemoveHandler var # Turn spelling support off (which would break URL shortcuts) <IfModule mod_speling.c> CheckSpelling Off </IfModule> # A few recommended PHP directives php_flag display_errors off # If you have Russian Apache with mod_charset installed, # do not forget to search for this line in your existing # configuration, and comment it out: # AddHandler strip-meta-http .htm .html VirtualHost 3 4 5 N |