MANUAL DE PHP

(y algo mas)windsurf pozo izquierdo
Google
search for in the  
ELMARRAJO.COM mysql bulma desarrollo web linux fedora html ayuda

windsurf mercedes camper

XII. Funciones de Clases/Objetos

Introducción

Estas funciones permiten obtener información sobre clases y objetos. Se puede obtener el nombre de la clase a la que pertenece un objeto, asi como las propiedades de sus miembros y métodos. Usando estas funciones se puede obtener no solo lo comentado en la frase anterior, también se puede obtener la familia del objeto (p.ej. qué clase está extendiendo la clase a la que pertenece el objeto).

Requisitos

No se necesitan bibliotecas externas para construir esta extensión

Instalación

No se necesita ninguna instalación para usar estas funciones, son parte del núcleo de PHP.

Configuración en tiempo de ejecución

Esta extensión no tiene directivas de configuración en php.ini.

Tipos de recursos

Esta extensión no tiene ningún tipo de recurso definido.

Constantes predefinidas

Esta extensión no tiene ninguna constante definida.

Ejemplos

En este ejemplo, definimos primero una clase base y una extensión de esta clase. La clase base define un vegetal genérico, si es comestible y su color. La subclase Spinach añade un metodo para cocinarlo y otro para saber si esta cocinado.

Ejemplo 1. classes.inc

<?php

// base class with member properties and methods
class Vegetable {

   var
$edible;
   var
$color;

   function
Vegetable( $edible, $color="green" ) {
      
$this->edible = $edible;
      
$this->color = $color;
   }

   function
is_edible() {
       return
$this->edible;
   }

   function
what_color() {
       return
$this->color;
   }
  
}
// end of class Vegetable

// extends the base class
class Spinach extends Vegetable {

   var
$cooked = false;

   function
Spinach() {
      
$this->Vegetable( true, "green" );
   }

   function
cook_it() {
      
$this->cooked = true;
   }

   function
is_cooked() {
       return
$this->cooked;
   }
  
}
// end of class Spinach

?>

Creamos 2 objetos de estas clases e imprimimos información sobre ellos, incluyendo la jerarquia de clases a la que pertenecen. También definimos algunas funciones, especialmente para imprimir las variables de una manera ordenada.

Ejemplo 2. test_script.php

<pre>
<?php

include "classes.inc";

// utility functions

function print_vars($obj) {
  
$arr = get_object_vars($obj);
   while (list(
$prop, $val) = each($arr))
       echo
"\t$prop = $val\n";
}

function
print_methods($obj) {
  
$arr = get_class_methods(get_class($obj));
   foreach (
$arr as $method)
       echo
"\tfunction $method()\n";
}

function
class_parentage($obj, $class) {
   global $
$obj;
   if (
is_subclass_of($$obj, $class)) {
       echo
"Object $obj belongs to class ".get_class($$obj);
       echo
" a subclass of $class\n";
   } else {
       echo
"Object $obj does not belong to a subclass of $class\n";
   }
}

// instantiate 2 objects

$veggie = new Vegetable(true,"blue");
$leafy = new Spinach();

// print out information about objects
echo "veggie: CLASS ".get_class($veggie)."\n";
echo
"leafy: CLASS ".get_class($leafy);
echo
", PARENT ".get_parent_class($leafy)."\n";

// show veggie properties
echo "\nveggie: Properties\n";
print_vars($veggie);

// and leafy methods
echo "\nleafy: Methods\n";
print_methods($leafy);

echo
"\nParentage:\n";
class_parentage("leafy", "Spinach");
class_parentage("leafy", "Vegetable");
?>
</pre>

One important thing to note in the example above is that the object $leafy is an instance of the class Spinach which is a subclass of Vegetable, therefore the last part of the script above will output:

[...]
Parentage:
Object leafy does not belong to a subclass of Spinach
Object leafy belongs to class spinach a subclass of Vegetable

Tabla de contenidos
call_user_method_array --  Llamar un método de usuario dado con una matriz de parámetros [obsoleta]
call_user_method --  Llamar un método de usuario en un objeto específico [obsoleta]
class_exists -- Verifica si la clase ha sido definida
get_class_methods -- Devuelve un vector (matriz unidimensional) con los nombres de los métodos de la clase en question.
get_class_vars --  Devuelve una matriz con las propiedades (inicializadas por defecto) de la clase
get_class -- Devuelve el nombre de la clase de un objeto
get_declared_classes -- Devuelve una matriz con el nombre de las clases definidas
get_declared_interfaces --  Devuelve una matriz de todas las interfaces declaradas
get_object_vars -- Devuelve un vector de propiedades del objecto
get_parent_class -- Recupera el nombre de la clase padre para un objeto o clase
interface_exists -- Verifica si la interfaz ha sido definida
is_a --  Devuelve TRUE si el objeto es de esta clase o tiene esta clase como uno de sus padres
is_subclass_of --  Devuelve TRUE si el objeto tiene esta clase como uno de sus padres
method_exists -- Comprueba que el metódo de clase existe
property_exists --  Verifica si el objeto o clase tiene una propiedad


add a note add a note User Contributed Notes
Funciones de Clases/Objetos
beconfused at googlemail dot com
20-Jul-2006 06:18
function from Tobias K.....
stdClass Object to XML

xml:
[CODE]
"$xml<?xml version='1.0' standalone='yes'?>" .
"<movies>" .
   "<movie eur=\"10.00\">" .
       "<title>PHP: Behind the Parser</title>" .
       "<characters>" .
           "<character>" .
               "<name>Ms. Coder</name>" .
               "<actor>Onlivia Actora</actor>" .
           "</character>" .
           "<character>" .
               "<name>Mr. Coder</name>" .
               "<actor>El ActÓr</actor>" .
           "</character>" .
       "</characters>" .
       "<plot>" .
           "Text bla bla." .
       "</plot>" .
       "<rating ulf=\"integer\">7</rating>" .
       "<rating type=\"stars\">5</rating>" .
   "</movie>" .
"</movies>";
[/CODE]

stdObject:
[CODE]
stdClass Object
(
   [movie] => stdClass Object
       (
           [title] => PHP: Behind the Parser
           [characters] => stdClass Object
               (
                   [character] => Array
                       (
                           [0] => stdClass Object
                               (
                                   [name] => Ms. Coder
                                   [actor] => Onlivia Actora
                               )

                           [1] => stdClass Object
                               (
                                   [name] => Mr. Coder
                                   [actor] => El ActÓr
                               )

                       )

               )

           [plot] => Text bla bla.
           [rating] => Array
               (
                   [0] => stdClass Object
                       (
                           [_] => 7
                           [ulf] => integer
                       )

                   [1] => stdClass Object
                       (
                           [_] => 5
                           [type] => stars
                       )

               )

           [eur] => 10
       )

)
[/CODE]

Aufruf:
[PHP]
$s = htmlentities(asXML($r,"movies",array(
   "movies/movie" => "eur",
   "movies/movie/rating" => "ulf type"
)));
[/PHP]

Funktion:
[PHP]
function asXML($obj, $name, $attrNames=NULL, &$xml="", $path="", $depth=0) {
   if (is_array($obj)) {
       foreach ($obj as $v)
           asXML($v,$name,$attrNames,$xml,$path,$depth);
   } else {
       if ($path) $xml .= "\n";
       $path = $path ? "$path/$name" : $name;
       $indent = str_repeat(" ",$depth*4);
       $xml .= "$indent<$name";
       $attr = $attrNames[$path];
       if ($attr) {
           if (!is_object($obj))
               throw new Exception("asXML(): ".
                       "$path is no object, so it cannot hold attributes");
           $attr = explode(" ",$attr);
           foreach ($attr as $key)
               if ($obj->$key) $xml .= " $key=\"{$obj->$key}\"";
       }
       $xml .= ">";
       if (is_object($obj)) {
           $xml .= $obj->_;
           $len = strlen($xml);
           foreach (get_object_vars($obj) as $key => $value)
               if ($key!="_" && (!is_array($attr) || !in_array($key,$attr)))
                   asXML($value,$key,$attrNames,$xml,$path,$depth+1);
           if ($len!=strlen($xml)) $xml .= "\n$indent";
       } else {
           $xml .= $obj;
       }
       $xml .= "</$name>";
   }
   return $xml;
}
[/PHP]
Chris
25-Oct-2005 03:06
You could reformat your query to use the 'as colname'
<?  $db->query("select found_rows() as found_rows"); ?>
pascal dot poncet at netconsult dot com
13-Oct-2005 07:21
Subject: using "sql_calc_found_rows" in a MySQL query while exploiting result in a PHP db class object.

Hello,

There is a nice function in MySQL that allows to know how many records would have been returned if no "where" clause were set : SQL_CALC_FOUND_ROWS.

If you have create a db object to collect the returned lines, you will be a little perplex when trying to call the result of this function.

Why ?
Simply because the returned field's name is "found_rows()" and obviously it's not possible to call something like :

<?php $result->found_rows() ?>

...as it will try to acces a method, not a property !

Then, the only way to get the right result seems to be the use of a class function, like :

<?php
  $db
->query("select found_rows()");
 
$count=current(get_object_vars(current($db->result)));
?>

Of course, if somebody found an other way to solve it, like a special syntax (see the one used with curled arrays in a string), I'm really open to discuss.

Good luck,
Pascal
ia [AT] zoznam [DOT] sk
02-Aug-2005 10:55
as for zabmilenko's solution:
wouldn't it be better to create it this way?

<?php
// The base class for all db classes
class DB {
 protected
$connectId;
}

// Class for MySQL, which extends base class
class MySQL extends DB {
 function
connect () {
 
$this->connectId = mysql_connect (...);
 }
}

// Class for PostgreSQL, which extends base class
class pgSQL extends DB {
 function
connect () {
 
$this->connectId = pg_connect (...);
 }
}

// and then call constructor like this:
$dbName = "MySQL";
$db = new $dbName ( ... );
// ... which creates an object of class MySQL
?>
zabmilenko at hotmail dot com
27-Jun-2005 12:08
((PHP5))

I wanted to dynamically choose an extender for a class.  This took awhile of playing with it but I came up with a solution.  Note that I can't verify how safe it is, but it appears to work for me.  Perhaps someone else can shed light on the details:

<?php

class A { var $value = "Class A\n"; }
class
B { var $value = "Class B\n"; }

// Uncomment which extender you want.  You can use variables as well.
// define('__EXTENDER__', 'A');
  
define('__EXTENDER__', 'B');

// Use eval to create a wrapper class.
eval('class EXTENDER extends '. __EXTENDER__ . ' { }');

class
C extends EXTENDER
{
  function
__construct()
  {
     echo
$this->value;
  }
}

$t = new C;

?>

Outputs:  Class B

Practical application:  I have a database abstraction system that has individual classes for mysql, pgsql, et al.  I want to be able to create a global db class that extends one of the individual db classes depending on the application configuration.

I know that there are probably much better ways of doing this but I haven't reached that level when it comes to classes.
cjones
03-Mar-2005 01:27
If anyone is interested in looking for a way to dynamically load existing objects into a class, here is what I found very useful.

//---------------------------------------------------------
// Dynamically load External Objects into a class

  function objRef ( &$obj ) {   
   eval("\$this->obj_".get_class($obj)." = \$obj;");
  }
//---------------------------------------------------------
// Reference by using: $this->obj_[object Name]->[var|f{}]

Example:

class date {  function date ( ) { $this->date = "March 3rd"; } }
class time {  function time ( ) { $this->time = "12:30pm"; } }

class show {
   function objRef ( &$obj ){
       eval("\$this->obj_".get_class($obj)." = \$obj;");
   }
   function test ( $var ){
       echo "$var".$this->obj_date->date." @ ".$this->obj_time->time;
   }
}

$date = new date;
$time = new time;
$show = new show;
   $show->objRef($date);
   $show->objRef($time);
   $show->test("Time Now => ");

// Output: Time Now => March 3rd @ 12:30pm

I found the prefix 'obj_' before the class name useful because it helped me to automatically identify external object references when scanning through my scripts. You can omit this if you want. Hope this helps someone.
http://sc.tri-bit.com/ StoneCypher
02-Mar-2005 10:25
to covertka at muohio dot edu and pillepop2003 at yahoo dot de:

There's a much easier solution to getting a class' name for working with a factory function.  Let's assume you're doing something like this:

<?php

 
function FactoryFunction($whatever, $instancedata) {

   switch (
$whatever) {
     case
'stuff'      : return new Stuff($instancedata);
     case
'otherstuff' : return new Otherstuff($instancedata);
   }

  }

?>

Now, consider the named parameter idiom and remember that PHP uses hashes for everything; as a result make the following changes:

<?php

 
function FactoryFunction($whatever, $instancedata) {

   switch (
$whatever) {

     case
'stuff'      : return array('typeis'=>'stuff',      'instance'=>new Stuff($instancedata));
     case
'otherstuff' : return array('typeis'=>'otherstuff', 'instance'=>new Otherstuff($instancedata));

   }

  }

?>

Nice 'n simple.  It seems that what the original poster wanted was something like C++ static data members; unfortunately as PHP4 has no static variables at all, there would need to be significant language change to support static-like behavior.  If you move to PHP5, the static keyword solves your problem cleanly.
covertka at muohio dot edu
02-Jan-2005 05:27
To pillepop2003 at yahoo dot de:

I have the same issue.  I have a base class that manages database tasks for a number of child classes.  One of the functions in the base class is a find() method that returns instances of the child classes.  Since find() is usually called as a static method, it needs to know the name of the child class.  As you've found, this appears to be impossible to get in an easy fashion.

The only way I've found to get the child class name is to use the debug_traceback() function.  This requires me to have a find() method in every child class, but it does work.

Here's an example:

<?php
 
require_once("Application.php");

  class
parentClass {
   function
find() {
    
$className = NULL;
     foreach (
debug_backtrace() as $bt) {
       if (
$bt['function'] == __FUNCTION__) {
        
$className = $bt['class'];
       }
     }

    
// here should be some code to find the proper id, let's assume it was id 1
    
$id = 1;
     return new
$className($id);
   }
  }
 
  class
foo extends parentClass {
   function
__construct($id) {
    
$this->id = id;
   }
  
   function
find() {
     return
parent::find();
   }
  }
 
  class
bar extends parentClass {
   function
__construct($id) {
    
$this->id = id;
   }

   function
find() {
     return
parent::find();
   }
  }
 
 
$a = foo::find();
 
printf("Type for \$a: %s<br/>\n", get_class($a));
 
$b = bar::find();
 
printf("Type for \$b: %s<br/>\n", get_class($b));
?>
iparanoid at gmx dot de
04-Aug-2004 11:17
To pillepop2003 at yahoo dot de:

It seems to me if there really is no nice way to get the class name in an un-instanciated class, there is a workaround in PHP5 though using static/class variables.

Example:

<?php

class myFoo
{
   static
$__ClassName = __CLASS__;

   static function
getClassName()
   {
       return
myFoo::$__ClassName;
   }
};

class
myFooExtended extends myFoo
{
   function
__construct()
   {
      
myFooExtended::$__ClassName = __CLASS__;
   };
};

?>

However, you'll need to have at least instanciated an object of the class myFooExtended before calling getClassName or introduce some other initialization (the class variable will need to be set at some point to __CLASS__ in the sub-class).
greg at doutromundo dot com
05-Jul-2004 07:58
As programmers, you're probably more organized than me, but, I do try and maintain some order in my classes and codes and separate them in "packages" as in java.
This helped me keep them organized but caused havok when trying to use them, so what I did was to create a class that handles the loading of classes (which I instanciate in all pages) along with my error handling class all bundled up. This way, I can load my classes with a command similar to
$baseClass->loadClass("package","className"[,"constructor"]);

the function responsible for this has some checking to see if they are loaded and stuff like that...

function loadClass($packageName,$className,$constructor=""){
  // if you dont have a constructor declare any function inside
  // the class
  if ($constructor==""){
   $constructor=$className;
  }
  if(!is_callable(array($className,$constructor))){
   if (defined("CLASS_DIR")){
     $pkg = CLASS_DIR.$packageName."/";
       if (is_dir($pkg)){
         // we have a directory with the package name
         $cls = $pkg.$className.".class.php";
         if(is_file($cls)){
           // we have a file
           include_once($cls);
         }else{
           die("Class <b>$className</b> could not be found in package <b>$packageName</b> , please check your instalation");
         }
       }else{
         die("Package <b>$packageName</b> could not be found, please check your instalation");
       }
     }
   }
}

Just remember to define CLASS_DIR as the physical path for the directories where you packages are...

Hope this comes in handy...

Here's an example of a diretory strucutre...
/var/www/classes/  <- this would be CLASS_DIR
in there I have:
package1/
     name.class.php
     name2.class.php
....

The loadClass would look like: loadClass("package1","name");

Cute and easy
ettinger at consultant dot com
18-Jun-2004 04:59
Re: Looking for an uninstantiated class

# Loads data from a table into a class object
class LFPDataFactory extends LFPObject {
       var $object;
       var $class;
       var $table;
       function LFPDataFactory($args) {
               $this->unpackArgs($args); // assigns locals from $args
               if (in_array(strtolower($this->class), get_declared_classes())) {
                       $this->object = new $this->class;
                       // assemble the columns in the table...
                       // select their values and put them in our new object...
               } else { trigger_error("Class ".$this->class." not found", E_USER_ERROR); }
       }
}
$r = new LFPDataFactory("class=LFPLayout,table=layout");
$new_obj = $r->object; // this is a LFPLayout object.
print_r($new_obj);

This class looks to see if the class exists, then instantiates it -- a declared class is not the same as an instantiated class. As long as LFPLayout exists somewhere in the scripts, get_declared_classes() will find it. Remember strtolower on compare, however.

Why would I do this? Because I have my class layouts the same as their respective tables; the factory then selects the data (making sure that the variables match) and plugs in the data. (I've left out the actual code to do the selection/insertion).
brett_hegr xATx yahoo xDOTx com
09-Jun-2004 05:46
// Useful function for determining if an object is either an
// instance or a subclass of a particular class.
function is_class($object,$class_name)
{
  $parent = is_a($object, $class_name);
  $child = is_subclass_of($object, $class_name);
  return $parent xor $child;
}
HOC
28-May-2004 09:40
to pillepop2003

Why do u want to know the classname of an non-existant object?

The only possible explanation for this question seems to me u want to know the class before u instantiate the object. Well, this is of no use since u always instantiate a class of ur choice.

When the class is instantiated into an object u can find the class of the object by means of get_class(). This is all u need. In case of inheritance u can use get_class($this) to get the class of the instantiated object. Now u can differentiate according to which class the object belongs to.

e.g.:

<?php
class A{
   function
A(){
    
$class_of_this = get_class($this);
     echo
'Object is an instance of class '.$class_of_this.' which is the ';
     if(
strcmp($class_of_this,'A')==0)
         echo
'parent-class';
     else if(
strcmp($class_of_this,'B')==0)
         echo
'child-class';
     echo
".\n";
   }
}

class
B extends A{
   function
B(){
    
$this->A();
   }
}

$object1 = new A();
$object2 = new B();
?>

When u run this code-snippet the output will be:

Object is an instance of class A which is the parent-class.
Object is an instance of class B which is the child-class.
mfirat at fibronline dot com
02-Apr-2004 05:18
<?php
  
class calculator {
     var
$c;
   function
addition($a, $b) {
      
$this->c = $a + $b;
       return
$this->c;
   }
      
   function
subtraction($a, $b) {
      
$this->c = $a - $b;
       return
$this->c;
   }
      
   function
multiplication($a, $b) {
      
$this->c = $a * $b;
       return
$this->c;
   }
      
   function
division($a, $b) {
      
$this->c = $a / $b;
       return
$this->c;
   }
 }

$cc = new calculator;
echo
$cc->addition(20, 10)."<br>";
echo
$cc->subtraction(20, 10)."<br>";
echo
$cc->multiplication(20, 10)."<br>";
echo
$cc->division(20, 10)."<br>";
?>
ar at 5mm de
28-Aug-2003 07:59
I missed some kind of function to dynamicly override or extend an Object:

-----------------------------------------
function &extendObj(&$obj, $code) {
   static $num = 0;
  
   $classname = get_class($obj);
   $newclass = $classname.$num;
  
   eval('class '.$newclass.' extends '.$classname.' { '.$code.' }');
  
   $newobj = new $newclass();

   $vars = get_class_vars($classname);
   foreach($vars AS $key=>$value) {
       $newobj->$key = &$obj->$key;
   }
  
   return $newobj;
}
-----------------------------------------

This creates a new class which extends the old one by the given code parameter, instanciates it and copy all vars from the old obj to the new one.

-----------------------------------------
class testA {
   var $prop = 'a';
  
   function funcA($val) {
       $this->prop = $val;
   }
  
   function value() {
       return $this->prop;
   }
}

$obj = new testA();

$newobj = &extendObj(&$obj, 'function addX() { $this->prop .= "x"; }');

$newobj->funcA('abc');
$newobj->addX();
echo $newobj->value();
-----------------------------------------

Results in 'abcx'. You can use the function multiple times and also with class variables. Be carefull, even if $newobj is just a copy of $obj, $obj->value() will return 'abcx', too, because of the & operator: $newobj->$key = &$obj->$key;
zidsu at hotmail dot com
08-Jul-2003 05:24
FYI: if you want to split your class into manageble chunks, what means different files for you, you can put you functoins into includes, and make include() have a return value. Like this:

class Some_class {
  var $value = 3;
  function add_value ($input_param) {
   return include ("path/some_file.php");
  }
}

And your included file:

$input_param += $this->value;
return $input_param;

Then your function call will be:

$instance = new Some_class ();
$instance->add_value (3);

And this will return
6
hopefully :P

Keep in mind though, that the scope in the included file will be identical to the scope the function 'add_value' has.
And if you want to return the outcome, you should also have a return statement made in your include as well.
asommer*at*as-media.com
20-Sep-2002 02:52
Something I found out just now that comes in very handy for my current project:

it is possible to have a class override itself in any method ( including the constructor ) like this:

class a {

..function ha ( ) {
....if ( $some_expr ) {
......$this = new b;
......return $this->ha ( );
....}
....return $something;
..}

}

in this case assuming that class b is already defined and also has the method ha ( )

note that the code after the statement to override itself is still executed but now applies to the new class

i did not find any information about this behaviour anywhere, so i have no clue wether this is supposed to be like this and if it might change... but it opens a few possibilities in flexible scripting!!
einhverfr at not-this-host dot hotmail dot com
14-Sep-2002 12:35
You may find it helpful in complex projects to have namespaces for your classes, and arrange these in a hierarchical manner.  A simple way to do this is to use the filesystem to order your hierarchies and then define a function like this:

function use_namespace($namespace){

require_once("namespaces/$namespace.obj.php");

}

(lack of indentation due to HTML UI for this page)
This requires that all your object libraries end in .obj.php (which I use) but you can modfy it to suit your needs.  To call it you could, for exmaple call:

use_namespace("example");
or if foo is part of example you can call:
use_namespace("example/foo");
justin at quadmyre dot com
19-Aug-2002 09:38
If you want to be able to call an instance of a class from within another class, all you need to do is store a reference to the external class as a property of the local class (can use the constructor to pass this to the class), then call the external method like this:

$this->classref->memberfunction($vars);

or if the double '->' is too freaky for you, how about:

$ref=&$this->classref;
$ref->memberfunction($vars);

This is handy if you write something like a general SQL class that you want member functions in other classes to be able to use, but want to keep namespaces separate. Hope that helps someone.

Justin

Example:

<?php

class class1 {
   function
test($var) {
      
$result = $var + 2;
       return
$result;
   }
}

class
class2{
   var
$ref_to_class=''; # to be pointer to other class

  
function class1(&$ref){ #constructor
      
$this->ref_to_class=$ref; #save ref to other class as property of this class
  
}

   function
test2($var){
      
$val = $this->ref_to_class->test($var); #call other class using ref
      
return $val;
   }
}

$obj1=new class1;
# obj1 is instantiated.
$obj2=new class2($obj1);
# pass ref to obj1 when instantiating obj2

$var=5;
$result=obj2->test2($var);
# call method in obj2, which calls method in obj1
echo ($result);

?>
a2zofciv2 at hotmail dot com
28-Sep-2001 10:10
I spent 20 minutes or so trying to figure this out, maybe someone else has the same problem.

To access a class' function from within the class you would have to say $this->functionname(params), rather than just functionname(params) like in other programming languages.

Hope this helps
gateschris at yahoo dot com
08-Mar-2001 01:59
[Editor's note: If you are trying to do overriding, then you can just interrogate (perhaps in the method itself) about what class (get_class()) the object belongs to, or if it is a subclass of a particular root class.

You can alway refer to the parent overriden method, see the "Classes and Objects" page of the manual and comments/editor's notes therein.]

There is no function to determine if a member belongs to a base class or current class eg:

class foo {
 function foo () { }
 function a () { }
}

class bar extends foo {
 function bar () { }
 function a () { }
}

lala = new Bar();
------------------
how do we find programmatically if member a now belongs to class Bar or Foo.

Citas célebres

El mayor de los enemigos es aquel que es capaz de vencer al adversario sin descargar un golpe.

Proverbio chino
Citas en tu mail
©Contenidos Gratis

Ilusiones Opticas
ilusion_optica_018.jpg
Contenidos Web

Chiste de... Médicos
Conoce a su marido

- Y dígame, ¿su marido también habla consigo mismo cuando está solo?

- No lo sé, nunca he estado con él cuando estaba solo.
Chistes en tu mail
©ContenidosGratis

Humor Gráfico
humor_grafico_055.jpg
Contenidos Web

Inicio | Acción | Estrategia | Palabras | Puzzles | Solitarios | Foro Trucos
Cake ManiaCake Mania
Jugadores: 6835
Categoría del juego: Acción
Objetivo del juego: Ayuda a Jill a recuperar la pastelería de su abuela llevando su propia pastelería; consigue clientes y gana dinero.
Rainbow WebRainbow Web
Jugadores: 2199
Categoría del juego: Puzzles
Objetivo del juego: Rompe un pegajoso hechizo y salva un reino de fantasía en Rainbow Web. Tendrás toneladas de diversión mientras juegas a este mágico desafío para la mente.
Mahjongg FortunaMahjongg Fortuna
Jugadores: 12462
Categoría del juego: Solitarios
Objetivo del juego: Velocidad y habilidad mental son las armas más importantes en esta versión de un antiguo juego asiático. Despeja el tablero lo antes posible haciendo clic en las fichas iguales y gánate la fama eterna de la puntuación más alta.
Chainz 2Chainz 2
Jugadores: 6955
Categoría del juego: Puzzles
Objetivo del juego: Entra en el mundo de las combinaciones con Chainz 2: Relinked, emocionante secuela del exitazo del año pasado, Chainz. Gira eslabones y crea combinaciones de 3 ó más.
DeliciousDelicious
Jugadores: 4405
Categoría del juego: Acción
Objetivo del juego: ¿Eres un as de la multitarea? ¿Quieres que tus clientes estén contentos? ¡Pues Delicious es tu juego! Sacia el apetito de los clientes y tenlos contentos; ¡no te arriesgues!
BookwormBookworm
Jugadores: 4568
Categoría del juego: Palabras
Objetivo del juego: Junta las letras para formar palabras. ¡Las palabras más largas valen más puntos!
ZumaZuma
Jugadores: 4976
Categoría del juego: Acción
Objetivo del juego: Controla el ídolo de la rana de piedra de los antiguos Zuma en este intrigante enigma de acción. ¡Dispara bolas para formar conjuntos de tres, pero si dejas que lleguen a la calavera dorada morirás!
Jewel of AtlantisJewel of Atlantis
Jugadores: 3798
Categoría del juego: Puzzles
Objetivo del juego: Descubre la ciudad hundida de la Atlántida y busca valiosos tesoros. Viaja más allá de las profundidades del mar y vive trepidantes aventuras en Jewel of Atlantis.
Jewel QuestJewel Quest
Jugadores: 3727
Categoría del juego: Puzzles
Objetivo del juego: Convierte la arena de la antigua selva en oro tan rápido como puedas juntando grupos de 3 elementos. ¡Los grupos más grandes valen más puntos!
Bejeweled 2Bejeweled 2
Jugadores: 3659
Categoría del juego: Puzzles
Objetivo del juego: Con cuatro modos de juego únicos y fascinantes, nuevas piezas de juego explosivas e imponentes fondos planetarios, Bejeweled 2 es mucho más adictivo que nunca.
Contenidos gratis en tu webSiguiente >>

Fotos divertidas
fotos_increibles_0405.jpg
Contenidos Web
microrobots avion deportes riesgo recetas cocina canaria juegos online gratis moto motociclismo horoscopos naranjas valencianas surf canarias montañismo ciudades turismo postales gratis library Horoscopos Diarios Windsurf Canarias
fregadero microondas placa electrica bañopreparar camper pantalla plananevera compresor electricacamper fiat ducato camper baño quimicomampara enrollable bañocamper aire climatizadofurgoneta surf windsurffurgoneta surf windsurftelevisor furgonetas camperfurgonetas camper cama

Sudoku del día
Nivel de dificultad: Fácil



Cómo jugar:
El juego consiste en colocar los números del 1 al nueve de tal forma que no se repita el mismo número en la columna, fila y caja (bloques 3x3 enmarcados).

©Contenidos Gratis | Sudoku en tu mail

Warning: array_rand(): First argument has to be an array in /var/www/html/contenidos/efemerides.php on line 14
Sucedió el...

31 de agosto de

Efemérides en tu mail
©Contenidos Gratis
windsurf canarias youtube porno canarias baleares valencia madrid