Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

is_resource(3) [php man page]

IS_RESOURCE(3)								 1							    IS_RESOURCE(3)

is_resource - Finds whether a variable is a resource

SYNOPSIS
bool is_resource (mixed $var) DESCRIPTION
Finds whether the given variable is a resource. PARAMETERS
o $var - The variable being evaluated. RETURN VALUES
Returns TRUE if $var is a resource, FALSE otherwise. EXAMPLES
Example #1 is_resource(3) example <?php $db_link = @mysql_connect('localhost', 'mysql_user', 'mysql_pass'); if (!is_resource($db_link)) { die('Can't connect : ' . mysql_error()); } ?> NOTES
Note is_resource(3) is not a strict type-checking method: it will return FALSE if $var is a resource variable that has been closed. SEE ALSO
The resource-type documentation, get_resource_type(3). PHP Documentation Group IS_RESOURCE(3)

Check Out this Related Man Page

IS_OBJECT(3)								 1							      IS_OBJECT(3)

is_object - Finds whether a variable is an object

SYNOPSIS
bool is_object (mixed $var) DESCRIPTION
Finds whether the given variable is an object. PARAMETERS
o $var - The variable being evaluated. RETURN VALUES
Returns TRUE if $var is an object, FALSE otherwise. EXAMPLES
Example #1 is_object(3) example <?php // Declare a simple function to return an // array from our object function get_students($obj) { if (!is_object($obj)) { return false; } return $obj->students; } // Declare a new class instance and fill up // some values $obj = new stdClass(); $obj->students = array('Kalle', 'Ross', 'Felipe'); var_dump(get_students(null)); var_dump(get_students($obj)); ?> NOTES
Note This function will return FALSE if used on an unserialized object where the class definition is not present (even though gettype(3) returns object). SEE ALSO
is_bool(3), is_int(3), is_float(3), is_string(3), is_array(3). PHP Documentation Group IS_OBJECT(3)
Man Page

13 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

100 interesting shell scripting problems

Hi all, I'm just learning to write shell scripts (new to the whole UNIX thing) and I'm wondering if anyone would like to help me create a resource to help me, and others like me, learn scripting. It would be something like "100 interesting shell scripting problems". All I need are... (7 Replies)
Discussion started by: nickednamed
7 Replies

2. Solaris

Solaris 10 virtual disk (ramdisk) create for sun4v (T-2000 simulator) architecture

have been trying to create a 2 GB ramdisk (virtual) to run on my T-2000 simulator (Legion) which has sun4v architecture. I have a SPARC workstation which runs on sun4u architecture with Solaris 10. I have created a ramdisk image using dd command, newfs, then used ufsrestore to restore the... (3 Replies)
Discussion started by: Zam_1234
3 Replies

3. Red Hat

Memory release latency issue

I have an application that routinely alloc() and realloc() gigabyte blocks of memory for image processing applications; specifically performing rotations of huge images, or creating/ deleting huge image buffers to contain multiple images. Immediately upon completion of an operation I call free() to... (9 Replies)
Discussion started by: imagtek
9 Replies

4. AIX

View IP of HMC from AIX

Trying to get the IP address of the HMC connected to some servers running AIX 6 and 7. I thought this would be as easy as running 'lsrsrc IBM.MCP IPAddresses', but when I run that command, the resource is empty. Is there some where else I should be looking, or is there a reason why this resource... (5 Replies)
Discussion started by: acascianelli
5 Replies

5. UNIX for Dummies Questions & Answers

Using alias after issuing 'su - user'

Hi, Using ksh, I have set up aliases (which work fine) in my user's .profile like this: alias ll = 'ls -lrt' alias cls = 'clear' How do I call these same aliases so that they will work after issuing this: ? su - user I do not want to add aliases to the su shell's .profile or .kshrc. (7 Replies)
Discussion started by: ocbit
7 Replies

6. AIX

Advice on why Core file is not being created

We have a user where a process is behaving abnormally and crashing. It would be great if a core file was generated, but I don't see one. user101671:/apps/ -$lscore -d compression: on path specification: on corefile location: /opt/core naming specification: off There is no core file being... (3 Replies)
Discussion started by: netmaster
3 Replies

7. Debian

Profiling Processes while shutdown

I was wondering how can I find the culprit of a slow shutdown on my debian box? I am actually looking for a diagnosis tool that might dump the process name and amount of time it took to close the process after signal was send. As for now I am trying to use journalctl to seek some information,... (5 Replies)
Discussion started by: Varun Pandey
5 Replies

8. UNIX for Beginners Questions & Answers

Count the number of files to delete doesnt match

Good evening, need your help please Need to delete certain files before octobre 1 2016, so need to know how many files im going to delete, for instance ls -lrt file_20160*.lis!wc -l but using grep -c to another file called bplist which contains the list of all files backed up doesn match... (7 Replies)
Discussion started by: alexcol
7 Replies

9. UNIX and Linux Applications

Having too many connections could affect performance ?

Good evening, i need your help please I will try to describe the scenario briefly: In a Telecom Production system application receives a certain files called CDRs(call detail records) to be processed by doing some operating systems operations and then database operations like creating indexes... (4 Replies)
Discussion started by: alexcol
4 Replies

10. Shell Programming and Scripting

sed parser behaving strange on replacing multiple words in multiple files

I have 4000 files like $cat clus_grp_seq10_g.phy 18 1002 anig_OJJ65951_1 ATGGTTTCGCAGCGTGATAGAGAATTGTTTAGGGATGATATTCGCTCGCGAGGAACGAAGCTCAATGCTGCCGAGCGCGAGAGTCTGCTAAGGCCATATCTGCCAGATCCGTCTGACCTTCCACGCAGGCCACTTCAGCGGCGCAAGAAGGTTCCTCG aver_OOF92921_1 ... (1 Reply)
Discussion started by: sammy777888
1 Replies

11. UNIX for Beginners Questions & Answers

Providing virtual machine priority in kvm based virtual machines

Hi All, Is there any way I can prioritize my VMs when there is resource crunch in host machine so that some VMs will be allocated more vcpu, more memory than other VMs in kvm/qemu hypervisor based virtual machines? Lets say in my cloud environment my Ubuntu 16 compute hosts are running some... (0 Replies)
Discussion started by: SanjayK
0 Replies

12. UNIX for Beginners Questions & Answers

Why this script is not working as 'expected' when doing ssh with while read ... really confused?

Hi, I have a script below that is running ssh <host> <command> on some servers. Below is more or less the script. I have to modify it somehow to get rid of the 'confidential' hostnames check_log.bash #!/bin/bash # myPID=$$ parse_log () { sub="parse_log" host=${1} ... (2 Replies)
Discussion started by: newbie_01
2 Replies

13. Red Hat

Linux PaceMaker Equivalent to a SharedAddress Resource Type

In HA platforms, there is the concept of a "Scalable Resource Type, which included the sharedaddress" that is used in commonly Web Servers resource groups. The sharedaddress resource type is provided so a developer can use this Resource type to build their own scalable resource group. I see... (1 Reply)
Discussion started by: mrmurdock
1 Replies