The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.
AF_UNIX
(int )
AF_INET
(int )
AF_INET6
(int )
AF_DIVERT
(int )
SOCK_STREAM
(int )
SOCK_DGRAM
(int )
SOCK_RAW
(int )
SOCK_SEQPACKET
(int )
SOCK_RDM
(int )
SOCK_CONN_DGRAM
(int )
SOCK_DCCP
(int )
SOCK_NONBLOCK
(int )
SOCK_CLOEXEC
(int )
MSG_OOB
(int )
MSG_WAITALL
(int )
MSG_PEEK
(int )
MSG_DONTROUTE
(int )
MSG_EOR
(int )
MSG_EOF
(int )
MSG_ZEROCOPY
(int )
SO_DEBUG
(int )
SO_REUSEADDR
(int )
SO_REUSEPORT
(int )
SO_REUSEPORT
socket option: this
includes Linux, macOS and *BSD, but does not include Windows.
SO_KEEPALIVE
(int )
SO_DONTROUTE
(int )
SO_LINGER
(int )
SO_BROADCAST
(int )
SO_OOBINLINE
(int )
SO_SNDBUF
(int )
SO_RCVBUF
(int )
SO_SNDLOWAT
(int )
SO_RCVLOWAT
(int )
SO_SNDTIMEO
(int )
SO_RCVTIMEO
(int )
SO_TYPE
(int )
SO_ERROR
(int )
SO_ZEROCOPY
(int )
TCP_NODELAY
(int )
TCP_KEEPCNT
(int )
TCP_KEEPIDLE
(int )
TCP_KEEPINTVL
(int )
TCP_KEEPALIVE
(int )
TCP_NOTSENT_LOWAT
(int )
SO_MARK
(int )
SO_RTABLE
(int )
SO_ACCEPTFILTER
(int )
SO_DONTTRUNC
(int )
SO_WANTMORE
(int )
SO_INCOMING_CPU
(int )
SO_MEMINFO
(int )
SO_BPF_EXTENSIONS
(int )
SO_SETFIB
(int )
SO_ATTACH_REUSEPORT_CBPF
(int )
SO_DETACH_BPF
(int )
SO_DETACH_FILTER
(int )
SO_RERROR
(int )
SO_ZEROIZE
(int )
SO_SPLICE
(int )
SO_REUSEPORT_LB
(int )
SOL_FILTER
(int )
SOL_UDPLITE
(int )
UDPLITE_RECV_CSCOV
(int )
UDPLITE_SEND_CSCOV
(int )
TCP_DEFER_ACCEPT
(int )
TCP_CONGESTION
(int )
TCP_QUICKACK
(int )
TCP_REPAIR
(int )
TCP_SYNCNT
(int )
IP_DONTFRAG
(int )
IP_MTU_DISCOVER
(int )
IP_PMTUDISC_DO
(int )
IP_PMTUDISC_DONT
(int )
IP_PMTUDISC_WANT
(int )
IP_PMTUDISC_PROBE
(int )
IP_PMTUDISC_INTERFACE
(int )
IP_PMTUDISC_OMIT
(int )
IP_BIND_ADDRESS_NO_PORT
(int )
SOL_SOCKET
(int )
PHP_NORMAL_READ
(int )
PHP_BINARY_READ
(int )
SOL_TCP
(int )
SOL_UDP
(int )
The following constants are defined under Windows and UNIX-like platforms. Each constant is only defined if their equal is available on the platform.
SOCKET_EINTR
(int )
SOCKET_EBADF
(int )
SOCKET_EACCES
(int )
SOCKET_EFAULT
(int )
SOCKET_EINVAL
(int )
SOCKET_EMFILE
(int )
SOCKET_ENAMETOOLONG
(int )
SOCKET_ENOTEMPTY
(int )
SOCKET_ELOOP
(int )
SOCKET_EWOULDBLOCK
(int )
SOCKET_EREMOTE
(int )
SOCKET_EUSERS
(int )
SOCKET_ENOTSOCK
(int )
SOCKET_EDESTADDRREQ
(int )
SOCKET_EMSGSIZE
(int )
SOCKET_EPROTOTYPE
(int )
SOCKET_EPROTONOSUPPORT
(int )
SOCKET_ESOCKTNOSUPPORT
(int )
SOCKET_EOPNOTSUPP
(int )
SOCKET_EPFNOSUPPORT
(int )
SOCKET_EAFNOSUPPORT
(int )
SOCKET_EADDRNOTAVAIL
(int )
SOCKET_ENETDOWN
(int )
SOCKET_ENETUNREACH
(int )
SOCKET_ENETRESET
(int )
SOCKET_ECONNABORTED
(int )
SOCKET_ECONNRESET
(int )
SOCKET_ENOBUFS
(int )
SOCKET_EISCONN
(int )
SOCKET_ENOTCONN
(int )
SOCKET_ESHUTDOWN
(int )
SOCKET_ETIMEDOUT
(int )
SOCKET_ECONNREFUSED
(int )
SOCKET_EHOSTDOWN
(int )
SOCKET_EHOSTUNREACH
(int )
SOCKET_EALREADY
(int )
SOCKET_EINPROGRESS
(int )
The following constants are only defined under Windows.
SOCKET_ENOPROTOOPT
(int )
SOCKET_EADDRINUSE
(int )
SOCKET_ETOOMYREFS
(int )
SOCKET_EPROCLIM
(int )
SOCKET_EDUOT
(int )
SOCKET_ESTALE
(int )
SOCKET_EDISCON
(int )
SOCKET_SYSNOTREADY
(int )
SOCKET_VERNOTSUPPORTED
(int )
SOCKET_NOTINITIALISED
(int )
SOCKET_HOST_NOT_FOUND
(int )
SOCKET_TRY_AGAIN
(int )
SOCKET_NO_RECOVERY
(int )
SOCKET_NO_DATA
(int )
SOCKET_NO_ADDRESS
(int )
The following constants are only available on UNIX-like platforms. Each constant is only defined if their equal is available on the platform.
SOCKET_EPERM
(int )
SOCKET_ENOENT
(int )
SOCKET_EIO
(int )
SOCKET_ENXIO
(int )
SOCKET_E2BIG
(int )
SOCKET_EAGAIN
(int )
SOCKET_ENOMEM
(int )
SOCKET_ENOTBLK
(int )
SOCKET_EBUSY
(int )
SOCKET_EEXIST
(int )
SOCKET_EXDEV
(int )
SOCKET_ENODEV
(int )
SOCKET_ENOTDIR
(int )
SOCKET_EISDIR
(int )
SOCKET_ENFILE
(int )
SOCKET_ENOTTY
(int )
SOCKET_ENOSPC
(int )
SOCKET_ESPIPE
(int )
SOCKET_EROFS
(int )
SOCKET_EMLINK
(int )
SOCKET_EPIPE
(int )
SOCKET_ENOLCK
(int )
SOCKET_ENOSYS
(int )
SOCKET_ENOMSG
(int )
SOCKET_EIDRM
(int )
SOCKET_ECHRNG
(int )
SOCKET_EL2NSYNC
(int )
SOCKET_EL3HLT
(int )
SOCKET_EL3RST
(int )
SOCKET_ELNRNG
(int )
SOCKET_EUNATCH
(int )
SOCKET_ENOCSI
(int )
SOCKET_EL2HLT
(int )
SOCKET_EBADE
(int )
SOCKET_EBADR
(int )
SOCKET_EXFULL
(int )
SOCKET_ENOANO
(int )
SOCKET_EBADRQC
(int )
SOCKET_EBADSLT
(int )
SOCKET_ENOSTR
(int )
SOCKET_ENODATA
(int )
SOCKET_ETIME
(int )
SOCKET_ENOSR
(int )
SOCKET_ENONET
(int )
SOCKET_ENOLINK
(int )
SOCKET_EADV
(int )
SOCKET_ESRMNT
(int )
SOCKET_ECOMM
(int )
SOCKET_EPROTO
(int )
SOCKET_EMULTIHOP
(int )
SOCKET_EBADMSG
(int )
SOCKET_ENOTUNIQ
(int )
SOCKET_EBADFD
(int )
SOCKET_EREMCHG
(int )
SOCKET_ERESTART
(int )
SOCKET_ESTRPIPE
(int )
SOCKET_EPROTOOPT
(int )
SOCKET_ADDRINUSE
(int )
SOCKET_ETOOMANYREFS
(int )
SOCKET_EISNAM
(int )
SOCKET_EREMOTEIO
(int )
SOCKET_EDQUOT
(int )
SOCKET_ENOMEDIUM
(int )
SOCKET_EMEDIUMTYPE
(int )
SCM_RIGHTS
(int )
SCM_CREDENTIALS
(int )
SCM_CREDS
(int )
SCM_CREDS2
(int )
LOCAL_CREDS
(int )
LOCAL_CREDS_PERSISTENT
(int )
SKF_AD_OFF
(int )
SKF_AD_PROTOCOL
(int )
SKF_AD_PKTTYPE
(int )
SKF_AD_IFINDEX
(int )
SKF_AD_NLATTR
(int )
SKF_AD_NLATTR_NEST
(int )
SKF_AD_MARK
(int )
SKF_AD_QUEUE
(int )
SKF_AD_HATYPE
(int )
SKF_AD_RXHASH
(int )
SKF_AD_CPU
(int )
SKF_AD_ALU_XOR_X
(int )
SKF_AD_VLAN_TAG
(int )
SKF_AD_VLAN_TAG_PRESENT
(int )
SKF_AD_PAY_OFFSET
(int )
SKF_AD_RANDOM
(int )
SKF_AD_VLAN_TPID
(int )
SKF_AD_MAX
(int )
AI_ADDRCONFIG
(int )
AI_ALL
(int )
AI_CANONIDN
(int )
AI_CANONNAME
(int )
AI_IDN
(int )
AI_NUMERICHOST
(int )
AI_NUMERICSERV
(int )
AI_PASSIVE
(int )
AI_V4MAPPED
(int )
FIL_ATTACH
(int )
FIL_DETACH
(int )
IPPROTO_IP
(int )
IPPROTO_IPV6
(int )
IPV6_HOPLIMIT
(int )
IPV6_MULTICAST_HOPS
(int )
IPV6_MULTICAST_IF
(int )
IPV6_MULTICAST_LOOP
(int )
IPV6_PKTINFO
(int )
IPV6_RECVHOPLIMIT
(int )
IPV6_RECVPKTINFO
(int )
IPV6_RECVTCLASS
(int )
IPV6_TCLASS
(int )
IPV6_UNICAST_HOPS
(int )
IPV6_V6ONLY
(int )
IP_MULTICAST_IF
(int )
IP_MULTICAST_LOOP
(int )
IP_MULTICAST_TTL
(int )
IP_PORTRANGE
(int )
IP_PORTRANGE_DEFAULT
(int )
IP_PORTRANGE_HIGH
(int )
IP_PORTRANGE_LOW
(int )
MCAST_BLOCK_SOURCE
(int )
MCAST_JOIN_GROUP
(int )
MCAST_JOIN_SOURCE_GROUP
(int )
MCAST_LEAVE_GROUP
(int )
MCAST_LEAVE_SOURCE_GROUP
(int )
MCAST_UNBLOCK_SOURCE
(int )
MSG_CMSG_CLOEXEC
(int )
MSG_CONFIRM
(int )
MSG_CTRUNC
(int )
MSG_DONTWAIT
(int )
MSG_ERRQUEUE
(int )
MSG_MORE
(int )
MSG_NOSIGNAL
(int )
MSG_TRUNC
(int )
MSG_WAITFORONE
(int )
SOL_LOCAL
(int )
SOMAXCONN
(int )
SO_BINDTODEVICE
(int )
SO_FAMILY
(int )
SO_LABEL
(int )
SO_LISTENQLEN
(int )
SO_LISTENQLIMIT
(int )
SO_PASSCRED
(int )
SO_PEERLABEL
(int )
SO_EXCLUSIVEADDRUSE
(int )
SO_EXCLBIND
(int )
SO_NOSIGPIPE
(int )
SO_LINGER_SEC
(int )
SO_LINGER
but lingering is in seconds
as opposed to time clicks on macOs.
Available as of PHP 8.4.0. (macOs only)
SO_BINDTOIFINDEX
(int )
$a = get_defined_constants(TRUE);
foreach ($a as $k => $v) {
printf('%-25s <br/>', $k);
foreach ($v as $k => $v) {
printf('  --->%-25s %d<br/>', $k, $v);
}
}
this may look duplicate for previous anonymous post but that code snippet only return 1 for constants value
1-->first called the get_defined_constants by passing argument true to categorize the data
2-->then using foreach iterate over index of the array
3-->here printf is used to print title of the category
4-->then it move on to interrior array and display the list of contants available in each category along with its value
Seems like SOCKET_EAGAIN is an alias of SOCKET_EWOULDBLOCK (int 11)